diff --git a/src/strings/utils.cc b/src/strings/utils.cc index 6a419a7..05a3651 100644 --- a/src/strings/utils.cc +++ b/src/strings/utils.cc @@ -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