diff options
Diffstat (limited to 'src/util/string.h')
-rw-r--r-- | src/util/string.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/util/string.h b/src/util/string.h index 584ffb73a..122262af8 100644 --- a/src/util/string.h +++ b/src/util/string.h @@ -20,7 +20,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #pragma once #include "irrlichttypes_bloated.h" -#include <stdlib.h> +#include <cstdlib> #include <string> #include <cstring> #include <vector> @@ -231,12 +231,12 @@ inline std::vector<std::basic_string<T> > str_split( */ inline std::string lowercase(const std::string &str) { - std::string s2 = ""; + std::string s2; s2.reserve(str.size()); - for (size_t i = 0; i < str.size(); i++) - s2 += tolower(str[i]); + for (char i : str) + s2 += tolower(i); return s2; } @@ -607,8 +607,8 @@ std::vector<std::basic_string<T> > split(const std::basic_string<T> &s, T delim) */ inline bool is_number(const std::string &to_check) { - for (size_t i = 0; i < to_check.size(); i++) - if (!std::isdigit(to_check[i])) + for (char i : to_check) + if (!std::isdigit(i)) return false; return !to_check.empty(); |