mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Remove use of stringstream in NormalizeUniformKey (flutter/engine#37826)
This showed up as a hotspot in profiles.
This commit is contained in:
parent
53e7761af0
commit
2dcb890e67
@ -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,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user