Commit 1727e643 authored by Marco Bubke's avatar Marco Bubke

Utils: Use string view instead of a string

This is preventing unneeded mallocs.

Change-Id: Ia1f9b1be90635e7aa8b4b6f6e6705e5671f946c5
Reviewed-by: Tim Jenssen's avatarTim Jenssen <>
parent daa3aad6
...@@ -532,16 +532,16 @@ public: ...@@ -532,16 +532,16 @@ public:
} }
static static
BasicSmallString join(std::initializer_list<BasicSmallString> list) BasicSmallString join(std::initializer_list<SmallStringView> list)
{ {
size_type totalSize = 0; size_type totalSize = 0;
for (const BasicSmallString &string : list) for (SmallStringView string : list)
totalSize += string.size(); totalSize += string.size();
BasicSmallString joinedString; BasicSmallString joinedString;
joinedString.reserve(totalSize); joinedString.reserve(totalSize);
for (const BasicSmallString &string : list) for (SmallStringView string : list)
joinedString.append(string); joinedString.append(string);
return joinedString; return joinedString;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment