diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/StringUtils.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/StringUtils.cpp b/src/StringUtils.cpp index 2fb4f6a9a..e70c2dc50 100644 --- a/src/StringUtils.cpp +++ b/src/StringUtils.cpp @@ -304,8 +304,9 @@ AString & InPlaceUppercase(AString & s) AString StrToLower(const AString & s) { - AString res(s); - std::transform(res.begin(), res.end(), res.begin(), ::tolower); + AString res; + res.resize(s.size()); + std::transform(s.begin(), s.end(), res.begin(), ::tolower); return res; } @@ -315,8 +316,9 @@ AString StrToLower(const AString & s) AString StrToUpper(const AString & s) { - AString res(s); - std::transform(res.begin(), res.end(), res.begin(), ::toupper); + AString res; + res.resize(s.size()); + std::transform(s.begin(), s.end(), res.begin(), ::toupper); return res; } |