diff options
author | Treeston <treeston.mmoc@gmail.com> | 2020-08-24 16:38:39 +0200 |
---|---|---|
committer | Treeston <treeston.mmoc@gmail.com> | 2020-08-24 16:38:39 +0200 |
commit | fd05a353418e1be8f4d5194fd2222de7f3955241 (patch) | |
tree | 500a5d8c4f894b1750e9da39f9390593f4610995 /src/common/Utilities/Util.cpp | |
parent | 11c4a60fbe9d471618e0579f588706746ff3e439 (diff) |
Revert "[3.3.5] Core/ChatCommands: C++17 cleanup (if constexpr + std::string_view)"
This reverts commit 11c4a60fbe9d471618e0579f588706746ff3e439.
Diffstat (limited to 'src/common/Utilities/Util.cpp')
-rw-r--r-- | src/common/Utilities/Util.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/common/Utilities/Util.cpp b/src/common/Utilities/Util.cpp index cb70cc114d3..da086c6b6cc 100644 --- a/src/common/Utilities/Util.cpp +++ b/src/common/Utilities/Util.cpp @@ -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) |