diff options
| -rw-r--r-- | zenutil/include/zenutil/cache/cachekey.h | 24 |
1 files changed, 2 insertions, 22 deletions
diff --git a/zenutil/include/zenutil/cache/cachekey.h b/zenutil/include/zenutil/cache/cachekey.h index e6110a522..9d0a4ba6d 100644 --- a/zenutil/include/zenutil/cache/cachekey.h +++ b/zenutil/include/zenutil/cache/cachekey.h @@ -21,31 +21,11 @@ struct CacheKey return {.Namespace = ToLower(Namespace), .Bucket = ToLower(Bucket), .Hash = Hash}; } + auto operator<=>(const CacheKey&) const = default; + static const CacheKey Empty; }; -inline bool -operator==(const CacheKey& A, const CacheKey& B) -{ - return A.Namespace == B.Namespace && A.Bucket == B.Bucket && A.Hash == B.Hash; -} - -inline bool -operator!=(const CacheKey& A, const CacheKey& B) -{ - return A.Namespace != B.Namespace || A.Bucket != B.Bucket || A.Hash != B.Hash; -} - -inline bool -operator<(const CacheKey& A, const CacheKey& B) -{ - const std::string& NamespaceA = A.Namespace; - const std::string& NamespaceB = B.Namespace; - const std::string& BucketA = A.Bucket; - const std::string& BucketB = B.Bucket; - return NamespaceA == NamespaceB ? (BucketA == BucketB ? A.Hash < B.Hash : BucketA < BucketB) : NamespaceA < NamespaceB; -} - struct CacheChunkRequest { CacheKey Key; |