diff options
author | 2015-12-03 18:17:25 +0100 | |
---|---|---|
committer | 2015-12-03 18:17:25 +0100 | |
commit | 91605d3f4df9b9fb1490c276053ff274fb728816 (patch) | |
tree | ec89d290d9bfba3b27d4aa28336a5ac9a9d45a7a /src/lib/util/corestr.cpp | |
parent | 5232ca932afe0acc8c3ef2bd3599e04a8c7def69 (diff) |
clang-modernize part 1 (nw)
Diffstat (limited to 'src/lib/util/corestr.cpp')
-rw-r--r-- | src/lib/util/corestr.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/lib/util/corestr.cpp b/src/lib/util/corestr.cpp index b4a75a3bc48..336d788cabb 100644 --- a/src/lib/util/corestr.cpp +++ b/src/lib/util/corestr.cpp @@ -114,11 +114,11 @@ int core_strwildcmp(const char *sp1, const char *sp2) char *core_strdup(const char *str) { - char *cpy = NULL; - if (str != NULL) + char *cpy = nullptr; + if (str != nullptr) { cpy = (char *)osd_malloc_array(strlen(str) + 1); - if (cpy != NULL) + if (cpy != nullptr) strcpy(cpy, str); } return cpy; @@ -261,18 +261,18 @@ void strdelchr(std::string& str, char chr) void strreplacechr(std::string& str, char ch, char newch) { - for (size_t i = 0; i < str.length(); i++) + for (auto & elem : str) { - if (str[i] == ch) str[i] = newch; + if (elem == ch) elem = newch; } } std::string strtrimspace(std::string& str) { int start = 0; - for (size_t i = 0; i < str.length(); i++) + for (auto & elem : str) { - if (!isspace(UINT8(str[i]))) break; + if (!isspace(UINT8(elem))) break; start++; } int end = str.length(); |