From 44b844eeeb8702b9ce2421985a1645b9956c7ee6 Mon Sep 17 00:00:00 2001 From: levlam Date: Wed, 9 Mar 2022 16:40:50 +0300 Subject: [PATCH] Rename is_key_empty to is_hash_table_key_empty. --- tdutils/td/utils/FlatHashMapChunks.h | 4 ++-- tdutils/td/utils/FlatHashMapLinear.h | 4 ++-- tdutils/td/utils/HashTableUtils.h | 2 +- tdutils/td/utils/MapNode.h | 2 +- tdutils/td/utils/SetNode.h | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tdutils/td/utils/FlatHashMapChunks.h b/tdutils/td/utils/FlatHashMapChunks.h index 07c5a2d4f..c5bf6e8f7 100644 --- a/tdutils/td/utils/FlatHashMapChunks.h +++ b/tdutils/td/utils/FlatHashMapChunks.h @@ -257,7 +257,7 @@ class FlatHashTableChunks { } Iterator find(const KeyT &key) { - if (empty() || is_key_empty(key)) { + if (empty() || is_hash_table_key_empty(key)) { return end(); } const auto hash = calc_hash(key); @@ -326,7 +326,7 @@ class FlatHashTableChunks { template std::pair emplace(KeyT key, ArgsT &&...args) { - CHECK(!is_key_empty(key)); + CHECK(!is_hash_table_key_empty(key)); auto it = find(key); if (it != end()) { return {it, false}; diff --git a/tdutils/td/utils/FlatHashMapLinear.h b/tdutils/td/utils/FlatHashMapLinear.h index e9c8b614d..0ad8d5594 100644 --- a/tdutils/td/utils/FlatHashMapLinear.h +++ b/tdutils/td/utils/FlatHashMapLinear.h @@ -200,7 +200,7 @@ class FlatHashTable { } Iterator find(const KeyT &key) { - if (unlikely(nodes_ == nullptr) || is_key_empty(key)) { + if (unlikely(nodes_ == nullptr) || is_hash_table_key_empty(key)) { return end(); } auto bucket = calc_bucket(key); @@ -265,7 +265,7 @@ class FlatHashTable { template std::pair emplace(KeyT key, ArgsT &&...args) { try_grow(); - CHECK(!is_key_empty(key)); + CHECK(!is_hash_table_key_empty(key)); auto bucket = calc_bucket(key); while (true) { auto &node = nodes_[bucket]; diff --git a/tdutils/td/utils/HashTableUtils.h b/tdutils/td/utils/HashTableUtils.h index f0cfdac38..46c78f096 100644 --- a/tdutils/td/utils/HashTableUtils.h +++ b/tdutils/td/utils/HashTableUtils.h @@ -11,7 +11,7 @@ namespace td { template -bool is_key_empty(const KeyT &key) { +bool is_hash_table_key_empty(const KeyT &key) { return key == KeyT(); } diff --git a/tdutils/td/utils/MapNode.h b/tdutils/td/utils/MapNode.h index 5fa3a3605..bb39e2cc6 100644 --- a/tdutils/td/utils/MapNode.h +++ b/tdutils/td/utils/MapNode.h @@ -65,7 +65,7 @@ struct MapNode { } bool empty() const { - return is_key_empty(first); + return is_hash_table_key_empty(first); } void clear() { diff --git a/tdutils/td/utils/SetNode.h b/tdutils/td/utils/SetNode.h index 8c54f2c1e..dbef6a872 100644 --- a/tdutils/td/utils/SetNode.h +++ b/tdutils/td/utils/SetNode.h @@ -50,7 +50,7 @@ struct SetNode { } bool empty() const { - return is_key_empty(first); + return is_hash_table_key_empty(first); } void clear() {