Speeds up utils::string::toupper function

This commit is contained in:
Felipe Zimmerle 2017-03-31 14:35:26 -03:00
parent b3c8e97ff7
commit ba070c9eaa
No known key found for this signature in database
GPG Key ID: E6DFB08CE8B11277

View File

@ -140,12 +140,13 @@ std::string tolower(std::string str) {
std::string toupper(std::string str) {
std::locale loc;
std::string value;
value.resize(str.length());
for (std::string::size_type i=0; i < str.length(); ++i) {
value.assign(value + std::toupper(str[i], loc));
}
std::transform(str.begin(),
str.end(),
value.begin(),
::toupper);
return value;
}