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
ToLower(const std::string &str)
{
std::string result;
std::transform(str.begin(), str.end(), std::back_inserter(result),
::tolower);
return result;
std::stringstream ss;
for (auto &ch : str) { ss << ToLower(ch); }
return ss.str();
}
std::string
ToUpper(const std::string &str)
{
std::string result;
std::transform(str.begin(), str.end(), std::back_inserter(result),
::toupper);
return result;
std::stringstream ss;
for (auto &ch : str) { ss << ToUpper(ch); }
return ss.str();
}
std::string