diff options
author | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2023-05-02 15:52:59 +0200 |
---|---|---|
committer | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2023-05-02 15:54:29 +0200 |
commit | d9ae7419ab16d6e91469fcdc6a89dbc3afc5a030 (patch) | |
tree | f3d13059169ff4203faea61b5c44b86206b910c1 | |
parent | 8c41acc695980801523e82faa3675b4ede05bbce (diff) | |
download | manaserv-d9ae7419ab16d6e91469fcdc6a89dbc3afc5a030.tar.gz manaserv-d9ae7419ab16d6e91469fcdc6a89dbc3afc5a030.tar.bz2 manaserv-d9ae7419ab16d6e91469fcdc6a89dbc3afc5a030.tar.xz manaserv-d9ae7419ab16d6e91469fcdc6a89dbc3afc5a030.zip |
Fixed condition in compareStrI
The result of the first part of the condition, "itA < endA", was simply
unused. Discovered thanks to attribute ‘nodiscard’ [-Wunused-result] in
more recent C++ standard / compiler.
-rw-r--r-- | src/utils/string.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/utils/string.cpp b/src/utils/string.cpp index 028bd7c2..f5038d6d 100644 --- a/src/utils/string.cpp +++ b/src/utils/string.cpp @@ -69,7 +69,7 @@ int compareStrI(const std::string &a, const std::string &b) std::string::const_iterator itB = b.begin(); std::string::const_iterator endB = b.end(); - for (; itA < endA, itB < endB; ++itA, ++itB) + for (; itA < endA && itB < endB; ++itA, ++itB) { int comp = tolower(*itA) - tolower(*itB); if (comp) |