This commit is contained in:
Axel Kohlmeyer
2021-10-07 12:22:26 -04:00
parent a818be585d
commit 3661b8cd50

View File

@ -700,8 +700,8 @@ char *utils::strdup(const std::string &text)
std::string utils::lowercase(const std::string &text)
{
std::string converted;
for (auto c : text) converted += ::tolower(c);
std::string converted(text);
for (auto &c : converted) c = ::tolower(c);
return converted;
}
@ -711,8 +711,8 @@ std::string utils::lowercase(const std::string &text)
std::string utils::uppercase(const std::string &text)
{
std::string converted;
for (auto c : text) converted += ::toupper(c);
std::string converted(text);
for (auto &c : converted) c = ::toupper(c);
return converted;
}