Skip to content
This repository has been archived by the owner on Feb 25, 2025. It is now read-only.

Commit

Permalink
Remove use of stringstream in NormalizeUniformKey (#37826)
Browse files Browse the repository at this point in the history
This showed up as a hotspot in profiles.
  • Loading branch information
jason-simmons authored Nov 30, 2022
1 parent ff3a778 commit 280e24b
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions impeller/renderer/backend/gles/buffer_bindings_gles.cc
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,14 @@ bool BufferBindingsGLES::RegisterVertexStageInput(
}

static std::string NormalizeUniformKey(const std::string& key) {
std::stringstream stream;
for (size_t i = 0, count = key.length(); i < count; i++) {
auto ch = key.data()[i];
if (ch == '_') {
continue;
std::string result;
result.reserve(key.length());
for (char ch : key) {
if (ch != '_') {
result.push_back(toupper(ch));
}
stream << static_cast<char>(toupper(ch));
}
return stream.str();
return result;
}

static std::string CreateUnifiormMemberKey(const std::string& struct_name,
Expand Down

0 comments on commit 280e24b

Please sign in to comment.