From 6a9f694158055726aea33405a95f45445c16a6e7 Mon Sep 17 00:00:00 2001 From: Rubidium Date: Sat, 3 May 2025 11:46:27 +0200 Subject: [PATCH] Codechange: remove StrEmpty --- src/strgen/strgen.cpp | 2 +- src/string_func.h | 12 ------------ 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/src/strgen/strgen.cpp b/src/strgen/strgen.cpp index 09840d9cd1..3e6542a657 100644 --- a/src/strgen/strgen.cpp +++ b/src/strgen/strgen.cpp @@ -97,7 +97,7 @@ struct FileStringReader : StringReader { { this->StringReader::ParseFile(); - if (StrEmpty(_strgen.lang.name) || StrEmpty(_strgen.lang.own_name) || StrEmpty(_strgen.lang.isocode)) { + if (*_strgen.lang.name == '\0' || *_strgen.lang.own_name == '\0' || *_strgen.lang.isocode == '\0') { FatalError("Language must include ##name, ##ownname and ##isocode"); } } diff --git a/src/string_func.h b/src/string_func.h index 2150e5cd9a..6c3b48df33 100644 --- a/src/string_func.h +++ b/src/string_func.h @@ -58,18 +58,6 @@ struct CaseInsensitiveComparator { bool operator()(std::string_view s1, std::string_view s2) const { return StrCompareIgnoreCase(s1, s2) < 0; } }; -/** - * Check if a string buffer is empty. - * - * @param s The pointer to the first element of the buffer - * @return true if the buffer starts with the terminating null-character or - * if the given pointer points to nullptr else return false - */ -inline bool StrEmpty(const char *s) -{ - return s == nullptr || s[0] == '\0'; -} - bool IsValidChar(char32_t key, CharSetFilter afilter); size_t Utf8StringLength(std::string_view str);