diff options
author | babenko <[email protected]> | 2025-07-14 17:30:01 +0300 |
---|---|---|
committer | babenko <[email protected]> | 2025-07-14 18:59:50 +0300 |
commit | 552acf29b10e279e67a90cf1136a30aa57f5dcd1 (patch) | |
tree | 3dd6521d6878a5884f9cbb6fdd06f1c195b37d8e /library/cpp | |
parent | 9c3d6f63ae9bcef86f6871dab9b4e57bd97d35a9 (diff) |
YT-18571: Rename TCaseInsensitiveStringEqualityComparer -> TCaseInsensitiveStringEqualComparer, add TCaseInsensitiveStringLessComparer
commit_hash:2dbe3c3cf419a5310e7bf45d161f839e99040788
Diffstat (limited to 'library/cpp')
-rw-r--r-- | library/cpp/yt/string/string.cpp | 7 | ||||
-rw-r--r-- | library/cpp/yt/string/string.h | 9 |
2 files changed, 14 insertions, 2 deletions
diff --git a/library/cpp/yt/string/string.cpp b/library/cpp/yt/string/string.cpp index 7d58d474382..a346219144c 100644 --- a/library/cpp/yt/string/string.cpp +++ b/library/cpp/yt/string/string.cpp @@ -322,11 +322,16 @@ size_t TCaseInsensitiveStringHasher::operator()(TStringBuf arg) const } } -bool TCaseInsensitiveStringEqualityComparer::operator()(TStringBuf lhs, TStringBuf rhs) const +bool TCaseInsensitiveStringEqualComparer::operator()(TStringBuf lhs, TStringBuf rhs) const { return AsciiEqualsIgnoreCase(lhs, rhs); } +bool TCaseInsensitiveStringLessComparer::operator()(TStringBuf lhs, TStringBuf rhs) const +{ + return AsciiCompareIgnoreCase(lhs, rhs) < 0; +} + //////////////////////////////////////////////////////////////////////////////// bool TryParseBool(TStringBuf value, bool* result) diff --git a/library/cpp/yt/string/string.h b/library/cpp/yt/string/string.h index a0e1d96cd09..9e521204838 100644 --- a/library/cpp/yt/string/string.h +++ b/library/cpp/yt/string/string.h @@ -168,8 +168,15 @@ struct TCaseInsensitiveStringHasher size_t operator()(TStringBuf arg) const; }; -struct TCaseInsensitiveStringEqualityComparer +struct TCaseInsensitiveStringEqualComparer { + using is_transparent = void; + bool operator()(TStringBuf lhs, TStringBuf rhs) const; +}; + +struct TCaseInsensitiveStringLessComparer +{ + using is_transparent = void; bool operator()(TStringBuf lhs, TStringBuf rhs) const; }; |