We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b3c8e97 commit ba070c9Copy full SHA for ba070c9
src/utils/string.cc
@@ -140,12 +140,13 @@ std::string tolower(std::string str) {
140
141
142
std::string toupper(std::string str) {
143
- std::locale loc;
144
std::string value;
+ value.resize(str.length());
145
146
- for (std::string::size_type i=0; i < str.length(); ++i) {
147
- value.assign(value + std::toupper(str[i], loc));
148
- }
+ std::transform(str.begin(),
+ str.end(),
+ value.begin(),
149
+ ::toupper);
150
151
return value;
152
}
0 commit comments