filamat: Resolve string processing inefficiency (#2754)
Co-authored-by: Michael Lou <ylou@amazon.com>
This commit is contained in:
co-authored by
Michael Lou
parent
a6872c840c
commit
820f551eea
@@ -55,7 +55,7 @@ void LineDictionary::addText(const std::string& line) noexcept {
|
||||
cur++;
|
||||
len++;
|
||||
}
|
||||
std::string newLine(s, pos, len);
|
||||
std::string newLine(s + pos, len);
|
||||
addLine(std::move(newLine));
|
||||
cur++;
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ void compressShader(const char *s, Flattener &f, const LineDictionary& dictionar
|
||||
len++;
|
||||
}
|
||||
|
||||
std::string newLine(s, pos, len);
|
||||
std::string newLine(s + pos, len);
|
||||
|
||||
size_t index = dictionary.getIndex(newLine);
|
||||
if (index > UINT16_MAX) {
|
||||
|
||||
Reference in New Issue
Block a user