diff options
| author | Dan Engelbrecht <[email protected]> | 2022-05-12 10:20:19 +0200 |
|---|---|---|
| committer | Dan Engelbrecht <[email protected]> | 2022-05-12 10:25:46 +0200 |
| commit | 4e2e93d4e0cab545ac1273d1c04dfa99fb47a980 (patch) | |
| tree | 2e1629b705e3cef294a9d98ad5511cfcb342486d /zenutil/include | |
| parent | revert Bucket - Key parameter change (diff) | |
| download | zen-4e2e93d4e0cab545ac1273d1c04dfa99fb47a980.tar.xz zen-4e2e93d4e0cab545ac1273d1c04dfa99fb47a980.zip | |
manual <=> calls for strings in CacheKey
Diffstat (limited to 'zenutil/include')
| -rw-r--r-- | zenutil/include/zenutil/cache/cachekey.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/zenutil/include/zenutil/cache/cachekey.h b/zenutil/include/zenutil/cache/cachekey.h index 9d0a4ba6d..569a31441 100644 --- a/zenutil/include/zenutil/cache/cachekey.h +++ b/zenutil/include/zenutil/cache/cachekey.h @@ -21,7 +21,14 @@ struct CacheKey return {.Namespace = ToLower(Namespace), .Bucket = ToLower(Bucket), .Hash = Hash}; } - auto operator<=>(const CacheKey&) const = default; + auto operator<=>(const CacheKey& that) const + { + if (auto cmp = Namespace <=> that.Namespace; cmp != 0) + return cmp; + if (auto cmp = Bucket <=> that.Bucket; cmp != 0) + return cmp; + return Hash <=> that.Hash; + } static const CacheKey Empty; }; |