diff options
author | Vincent Richard <[email protected]> | 2005-12-30 20:29:36 +0000 |
---|---|---|
committer | Vincent Richard <[email protected]> | 2005-12-30 20:29:36 +0000 |
commit | 500f065c941f83f7ffba3e7892b0f702af94f605 (patch) | |
tree | 3850d87d18b518e640e2a5d11c2c634e1657785b /src/utility/stringUtils.cpp | |
parent | Fixed mistake. (diff) | |
download | vmime-500f065c941f83f7ffba3e7892b0f702af94f605.tar.gz vmime-500f065c941f83f7ffba3e7892b0f702af94f605.zip |
Rewritten some code without using iterators.
Diffstat (limited to 'src/utility/stringUtils.cpp')
-rw-r--r-- | src/utility/stringUtils.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/utility/stringUtils.cpp b/src/utility/stringUtils.cpp index c8bcbb0a..dd8c559d 100644 --- a/src/utility/stringUtils.cpp +++ b/src/utility/stringUtils.cpp @@ -77,25 +77,25 @@ const bool stringUtils::isStringEqualNoCase const string stringUtils::toLower(const string& str) { - string out(str); - const string::iterator end = out.end(); + string out; + out.resize(str.size()); - for (string::iterator i = out.begin() ; i != end ; ++i) - *i = std::tolower(*i, std::locale()); + for (string::size_type i = 0, len = str.length() ; i < len ; ++i) + out[i] = std::tolower(str[i], std::locale()); - return (out); + return out; } const string stringUtils::toUpper(const string& str) { - string out(str); - const string::iterator end = out.end(); + string out; + out.resize(str.size()); - for (string::iterator i = out.begin() ; i != end ; ++i) - *i = std::toupper(*i, std::locale()); + for (string::size_type i = 0, len = str.length() ; i < len ; ++i) + out[i] = std::toupper(str[i], std::locale()); - return (out); + return out; } |