From 820f551eea0db13db4f0893e0d28be7f549bcfdf Mon Sep 17 00:00:00 2001 From: Michael Lou Date: Tue, 30 Jun 2020 10:39:31 -0700 Subject: [PATCH] filamat: Resolve string processing inefficiency (#2754) Co-authored-by: Michael Lou --- libs/filamat/src/eiff/LineDictionary.cpp | 2 +- libs/filamat/src/eiff/MaterialTextChunk.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/filamat/src/eiff/LineDictionary.cpp b/libs/filamat/src/eiff/LineDictionary.cpp index e2276528d5..c5685a91a6 100644 --- a/libs/filamat/src/eiff/LineDictionary.cpp +++ b/libs/filamat/src/eiff/LineDictionary.cpp @@ -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++; } diff --git a/libs/filamat/src/eiff/MaterialTextChunk.cpp b/libs/filamat/src/eiff/MaterialTextChunk.cpp index c366748e42..f9d387784a 100644 --- a/libs/filamat/src/eiff/MaterialTextChunk.cpp +++ b/libs/filamat/src/eiff/MaterialTextChunk.cpp @@ -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) {