From 4ca23a19b6b4526d910822d03631c1b73008fe73 Mon Sep 17 00:00:00 2001 From: Rubidium Date: Thu, 8 Jun 2023 17:09:56 +0200 Subject: [PATCH] Cleanup: char-pointer variant of strtolower --- src/string.cpp | 22 ---------------------- src/string_func.h | 1 - 2 files changed, 23 deletions(-) diff --git a/src/string.cpp b/src/string.cpp index 8a092c6969..14e5fee364 100644 --- a/src/string.cpp +++ b/src/string.cpp @@ -471,28 +471,6 @@ size_t Utf8StringLength(const std::string &str) return Utf8StringLength(str.c_str()); } -/** - * Convert a given ASCII string to lowercase. - * NOTE: only support ASCII characters, no UTF8 fancy. As currently - * the function is only used to lowercase data-filenames if they are - * not found, this is sufficient. If more, or general functionality is - * needed, look to r7271 where it was removed because it was broken when - * using certain locales: eg in Turkish the uppercase 'I' was converted to - * '?', so just revert to the old functionality - * @param str string to convert - * @return String has changed. - */ -bool strtolower(char *str) -{ - bool changed = false; - for (; *str != '\0'; str++) { - char new_str = tolower(*str); - changed |= new_str != *str; - *str = new_str; - } - return changed; -} - bool strtolower(std::string &str, std::string::size_type offs) { bool changed = false; diff --git a/src/string_func.h b/src/string_func.h index 4a85f338c3..93f2b4e1de 100644 --- a/src/string_func.h +++ b/src/string_func.h @@ -43,7 +43,6 @@ void StrMakeValidInPlace(char *str, StringValidationSettings settings = SVS_REPL void str_fix_scc_encoded(char *str, const char *last) NOACCESS(2); void str_strip_colours(char *str); -bool strtolower(char *str); bool strtolower(std::string &str, std::string::size_type offs = 0); [[nodiscard]] bool StrValid(const char *str, const char *last) NOACCESS(2);