fix remove std::transform
All checks were successful
linux-x64-gcc / linux-gcc (Debug) (push) Successful in 34s
linux-x64-gcc / linux-gcc (Release) (push) Successful in 36s

This commit is contained in:
tqcq 2024-03-05 09:44:42 +08:00
parent 4402688c9c
commit 5900bdf0f6

View File

@ -19,19 +19,17 @@ ToUpper(char c)
std::string std::string
ToLower(const std::string &str) ToLower(const std::string &str)
{ {
std::string result; std::stringstream ss;
std::transform(str.begin(), str.end(), std::back_inserter(result), for (auto &ch : str) { ss << ToLower(ch); }
::tolower); return ss.str();
return result;
} }
std::string std::string
ToUpper(const std::string &str) ToUpper(const std::string &str)
{ {
std::string result; std::stringstream ss;
std::transform(str.begin(), str.end(), std::back_inserter(result), for (auto &ch : str) { ss << ToUpper(ch); }
::toupper); return ss.str();
return result;
} }
std::string std::string