aboutsummaryrefslogtreecommitdiff
path: root/zencore/include
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2022-05-12 12:16:03 +0200
committerDan Engelbrecht <[email protected]>2022-05-12 12:16:03 +0200
commite45d87b8834d204a130f09daf9009b85f3cd32ef (patch)
tree2515a259075a46745e71b62abfadee293eefe9c8 /zencore/include
parentstring_view vs string lifetime fix (diff)
downloadzen-e45d87b8834d204a130f09daf9009b85f3cd32ef.tar.xz
zen-e45d87b8834d204a130f09daf9009b85f3cd32ef.zip
use string::compare in caseSensitiveCompareStrings
Diffstat (limited to 'zencore/include')
-rw-r--r--zencore/include/zencore/string.h11
1 files 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;
}
//////////////////////////////////////////////////////////////////////////