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.

(cherry picked from commit 572eab1c35)
This commit is contained in:
jackpoz
2018-02-17 23:26:50 +01:00
committed by funjoker
parent cb0a889177
commit b7aef385e8
4 changed files with 18 additions and 8 deletions

View File

@@ -197,10 +197,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;
}
@@ -301,7 +303,8 @@ void PlayerDump::InitializeTables()
f.FieldName = columnName;
f.IsBinaryField = !boost::ifind_first(typeName, "binary").empty() || !boost::ifind_first(typeName, "blob").empty();
ASSERT(Utf8ToUpperOnlyLatin(columnName));
bool toUpperResult = Utf8ToUpperOnlyLatin(columnName);
ASSERT(toUpperResult);
t.TableFields.emplace_back(std::move(f));
} while (result->NextRow());