Core/Misc: ASSERT() cleanup

Move some functions calls out of ASSERT() calls. ASSERT() should only apply checks without modifying any object and without having any side effect.
This commit is contained in:
jackpoz authored and Aokromes committed 2018-02-18 18:00:27 +01:00
1 parent c4342a7756
commit 4a7089b10a
4 files changed
+16 -7

No files matched your search

+6 -3
View File
@@ -169,10 +169,12 @@ std::vector<TableStruct> CharacterTables;
inline bool StringsEqualCaseInsensitive(std::string const& left, std::string const& right)
{
std::string upperLeftString = left;
ASSERT(Utf8ToUpperOnlyLatin(upperLeftString));
bool leftResult = Utf8ToUpperOnlyLatin(upperLeftString);
ASSERT(leftResult);
std::string upperRightString = right;
ASSERT(Utf8ToUpperOnlyLatin(upperRightString));
bool rightResult = Utf8ToUpperOnlyLatin(upperRightString);
ASSERT(rightResult);
return upperLeftString == upperRightString;
}
@@ -271,7 +273,8 @@ void PlayerDump::InitializeTables()
TableField f;
f.FieldName = columnName;
ASSERT(Utf8ToUpperOnlyLatin(columnName));
bool toUpperResult = Utf8ToUpperOnlyLatin(columnName);
ASSERT(toUpperResult);
t.TableFields.emplace_back(std::move(f));
} while (result->NextRow());