Revert "[3.3.5] Core/ChatCommands: C++17 cleanup (if constexpr + std::string_view)"

This reverts commit 11c4a60fbe.
This commit is contained in:
Treeston
2020-08-24 16:38:39 +02:00
parent 11c4a60fbe
commit fd05a35341
13 changed files with 532 additions and 557 deletions

View File

@@ -651,13 +651,9 @@ void Trinity::Impl::HexStrToByteArray(std::string_view str, uint8* out, size_t o
}
}
Optional<bool> StringToBool(std::string_view str)
bool StringToBool(std::string_view str)
{
if (str == "1" || StringEqualI(str, "y") || StringEqualI(str, "on") || StringEqualI(str, "yes") || StringEqualI(str, "true"))
return true;
if (str == "0" || StringEqualI(str, "n") || StringEqualI(str, "off") || StringEqualI(str, "no") || StringEqualI(str, "false"))
return false;
return std::nullopt;
return ((str == "1") || StringEqualI(str, "true") || StringEqualI(str, "yes"));
}
bool StringEqualI(std::string_view str1, std::string_view str2)