mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-14 05:45:59 +03:00
Speeds up utils::string::toupper function
This commit is contained in:
parent
b3c8e97ff7
commit
ba070c9eaa
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user