From e45d87b8834d204a130f09daf9009b85f3cd32ef Mon Sep 17 00:00:00 2001 From: Dan Engelbrecht Date: Thu, 12 May 2022 12:16:03 +0200 Subject: use string::compare in caseSensitiveCompareStrings --- zencore/include/zencore/string.h | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/zencore/include/zencore/string.h b/zencore/include/zencore/string.h index fe838ac19..92f567dae 100644 --- a/zencore/include/zencore/string.h +++ b/zencore/include/zencore/string.h @@ -807,15 +807,8 @@ StrCaseCompare(const char* Lhs, const char* Rhs, int64_t Length = -1) inline auto caseSensitiveCompareStrings(const std::string& Lhs, const std::string& Rhs) { - if (Lhs == Rhs) - { - return std::strong_ordering::equal; - } - if (Lhs < Rhs) - { - return std::strong_ordering::less; - } - return std::strong_ordering::greater; + int r = Lhs.compare(Rhs); + return r == 0 ? std::strong_ordering::equal : r < 0 ? std::strong_ordering::less : std::strong_ordering::greater; } ////////////////////////////////////////////////////////////////////////// -- cgit v1.2.3