mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-16 17:29:55 +00:00
Reserve the output buffer in lowerCaseUtf8
Since lowercasing an utf8 string shouldn't change its size very much, it does make sense to reserve the output buffer, to reduce memory allocations.
This commit is contained in:
parent
5815faecda
commit
9f62f0c292
1 changed files with 1 additions and 0 deletions
|
@ -129,6 +129,7 @@ public:
|
|||
|
||||
// Decode string as utf8 characters, convert to lower case and pack them to string
|
||||
std::string out;
|
||||
out.reserve(str.length());
|
||||
Utf8Stream stream (str);
|
||||
while (!stream.eof ())
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue