aboutsummaryrefslogtreecommitdiffhomepage
path: root/tdutils/td/utils/WaitFreeHashMap.h
diff options
context:
space:
mode:
authorlevlam <levlam@telegram.org>2022-11-23 19:37:32 +0300
committerlevlam <levlam@telegram.org>2022-11-23 19:37:32 +0300
commitaf05db3f15fd36932b64e270a7663a8ba34d065e (patch)
tree673cb43a0e58dafc85260b096954a4a56f837aa0 /tdutils/td/utils/WaitFreeHashMap.h
parentb1ddf9d3a7c739b9cdfdfe55fa34c6d2ccbadab5 (diff)
Add td::Hash and use it everywhere instead of unusable std::hash.
Diffstat (limited to 'tdutils/td/utils/WaitFreeHashMap.h')
-rw-r--r--tdutils/td/utils/WaitFreeHashMap.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/tdutils/td/utils/WaitFreeHashMap.h b/tdutils/td/utils/WaitFreeHashMap.h
index 6dbb6d2b8..0d03ea2b2 100644
--- a/tdutils/td/utils/WaitFreeHashMap.h
+++ b/tdutils/td/utils/WaitFreeHashMap.h
@@ -14,7 +14,7 @@
namespace td {
-template <class KeyT, class ValueT, class HashT = std::hash<KeyT>, class EqT = std::equal_to<KeyT>>
+template <class KeyT, class ValueT, class HashT = Hash<KeyT>, class EqT = std::equal_to<KeyT>>
class WaitFreeHashMap {
static constexpr size_t MAX_STORAGE_COUNT = 1 << 8;
static_assert((MAX_STORAGE_COUNT & (MAX_STORAGE_COUNT - 1)) == 0, "");
@@ -29,7 +29,7 @@ class WaitFreeHashMap {
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);
}
WaitFreeHashMap &get_wait_free_storage(const KeyT &key) {