diff options
Diffstat (limited to 'src/util.cc')
-rw-r--r-- | src/util.cc | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/util.cc b/src/util.cc index 6fc650a..9052118 100644 --- a/src/util.cc +++ b/src/util.cc @@ -7,12 +7,16 @@ #include <fstream> #include <algorithm> #include <sstream> +#include <cctype> -std::string to_lower(const std::string& str) +std::string to_lower(std::string str) { - std::string out{str}; - std::transform(out.begin(), out.end(), out.begin(), ::tolower); - return out; + std::transform(str.begin(), str.end(), str.begin(), + [](unsigned char c) + { + return std::tolower(c); + }); + return str; } std::string readFile(const std::string& fileName) |