diff options
author | Benoit Foucher <benoit@zeroc.com> | 2009-02-03 17:32:50 +0100 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2009-02-03 17:32:50 +0100 |
commit | e52df27d301c9a85252874ddb2fb85f1bf34b1cf (patch) | |
tree | 1e886808106ec1c189bc1186d9b39ffb5debca6e /cpp/src/IceUtil/StringUtil.cpp | |
parent | Fixed bug 2888 - added --java2 option to demo scripts as well (diff) | |
download | ice-e52df27d301c9a85252874ddb2fb85f1bf34b1cf.tar.bz2 ice-e52df27d301c9a85252874ddb2fb85f1bf34b1cf.tar.xz ice-e52df27d301c9a85252874ddb2fb85f1bf34b1cf.zip |
Minor fix for bug 3519
Diffstat (limited to 'cpp/src/IceUtil/StringUtil.cpp')
-rw-r--r-- | cpp/src/IceUtil/StringUtil.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/cpp/src/IceUtil/StringUtil.cpp b/cpp/src/IceUtil/StringUtil.cpp index 8965020fab8..11bcf108a96 100644 --- a/cpp/src/IceUtil/StringUtil.cpp +++ b/cpp/src/IceUtil/StringUtil.cpp @@ -691,7 +691,8 @@ string IceUtilInternal::toLower(const std::string& s) { string result; - for(unsigned int i = 0; i < s.length(); ++ i) + result.reserve(s.size()); + for(unsigned int i = 0; i < s.length(); ++i) { result += tolower(static_cast<unsigned char>(s[i])); } @@ -702,7 +703,8 @@ string IceUtilInternal::toUpper(const std::string& s) { string result; - for(unsigned int i = 0; i < s.length(); ++ i) + result.reserve(s.size()); + for(unsigned int i = 0; i < s.length(); ++i) { result += toupper(static_cast<unsigned char>(s[i])); } |