diff options
author | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2024-10-23 12:04:54 +0200 |
---|---|---|
committer | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2025-03-13 09:44:31 +0100 |
commit | 79e4325192f3260ed4ded264e43da8429650bf72 (patch) | |
tree | e64eaf10c378078fa97aecbeac3fa325df605ba2 /src/utils/stringutils.cpp | |
parent | bde9d2d83dc703dd961861c3e6705bca28303cdb (diff) | |
download | mana-79e4325192f3260ed4ded264e43da8429650bf72.tar.gz mana-79e4325192f3260ed4ded264e43da8429650bf72.tar.bz2 mana-79e4325192f3260ed4ded264e43da8429650bf72.tar.xz mana-79e4325192f3260ed4ded264e43da8429650bf72.zip |
Removed needless case-insensitive string comparisons
These are not necessary since we can instead make sure the referenced
values match case, like we do for everything else.
This affects server types in the server list and colors referenced in
theme files. The server version was also compared case-insensitively
for some reason.
Diffstat (limited to 'src/utils/stringutils.cpp')
-rw-r--r-- | src/utils/stringutils.cpp | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/src/utils/stringutils.cpp b/src/utils/stringutils.cpp index 0244dd8c..2354eb85 100644 --- a/src/utils/stringutils.cpp +++ b/src/utils/stringutils.cpp @@ -125,29 +125,6 @@ std::string removeColors(std::string msg) return msg; } -int compareStrI(const std::string &a, const std::string &b) -{ - std::string::const_iterator itA = a.begin(); - std::string::const_iterator endA = a.end(); - std::string::const_iterator itB = b.begin(); - std::string::const_iterator endB = b.end(); - - for (; itA < endA && itB < endB; ++itA, ++itB) - { - int comp = tolower(*itA) - tolower(*itB); - if (comp) - return comp; - } - - // Check string lengths - if (itA == endA && itB == endB) - return 0; - else if (itA == endA) - return -1; - else - return 1; -} - bool isWordSeparator(char chr) { return (chr == ' ' || chr == ',' || chr == '.' || chr == '"'); |