diff options
author | Mattes D <github@xoft.cz> | 2017-02-13 19:56:34 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-13 19:56:34 +0100 |
commit | 72e401313b9e8ba6b67672646a62747f27f235b5 (patch) | |
tree | 0deba57067e3095cf2b2e398d9c0f1d494b604c1 /src | |
parent | Merge pull request #3569 from cuberite/AddVerticalConn (diff) | |
download | cuberite-72e401313b9e8ba6b67672646a62747f27f235b5.tar cuberite-72e401313b9e8ba6b67672646a62747f27f235b5.tar.gz cuberite-72e401313b9e8ba6b67672646a62747f27f235b5.tar.bz2 cuberite-72e401313b9e8ba6b67672646a62747f27f235b5.tar.lz cuberite-72e401313b9e8ba6b67672646a62747f27f235b5.tar.xz cuberite-72e401313b9e8ba6b67672646a62747f27f235b5.tar.zst cuberite-72e401313b9e8ba6b67672646a62747f27f235b5.zip |
Diffstat (limited to '')
-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; } |