diff options
| author | levlam <levlam@telegram.org> | 2022-11-23 19:37:32 +0300 |
|---|---|---|
| committer | levlam <levlam@telegram.org> | 2022-11-23 19:37:32 +0300 |
| commit | af05db3f15fd36932b64e270a7663a8ba34d065e (patch) | |
| tree | 673cb43a0e58dafc85260b096954a4a56f837aa0 /tdutils/td/utils/WaitFreeHashSet.h | |
| parent | b1ddf9d3a7c739b9cdfdfe55fa34c6d2ccbadab5 (diff) | |
Add td::Hash and use it everywhere instead of unusable std::hash.
Diffstat (limited to 'tdutils/td/utils/WaitFreeHashSet.h')
| -rw-r--r-- | tdutils/td/utils/WaitFreeHashSet.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tdutils/td/utils/WaitFreeHashSet.h b/tdutils/td/utils/WaitFreeHashSet.h index c7e6ad808..2148c2837 100644 --- a/tdutils/td/utils/WaitFreeHashSet.h +++ b/tdutils/td/utils/WaitFreeHashSet.h @@ -14,7 +14,7 @@ namespace td { -template <class KeyT, class HashT = std::hash<KeyT>, class EqT = std::equal_to<KeyT>> +template <class KeyT, class HashT = Hash<KeyT>, class EqT = std::equal_to<KeyT>> class WaitFreeHashSet { static constexpr size_t MAX_STORAGE_COUNT = 1 << 8; static_assert((MAX_STORAGE_COUNT & (MAX_STORAGE_COUNT - 1)) == 0, ""); @@ -29,7 +29,7 @@ class WaitFreeHashSet { uint32 max_storage_size_ = DEFAULT_STORAGE_SIZE; uint32 get_wait_free_index(const KeyT &key) const { - return randomize_hash(HashT()(key) * hash_mult_) & (MAX_STORAGE_COUNT - 1); + return (HashT()(key) * hash_mult_) & (MAX_STORAGE_COUNT - 1); } WaitFreeHashSet &get_wait_free_storage(const KeyT &key) { |
