Rename is_key_empty to is_hash_table_key_empty.

This commit is contained in:
levlam 2022-03-09 16:40:50 +03:00
parent 8b897c7c5f
commit 44b844eeeb
5 changed files with 7 additions and 7 deletions

View File

@ -257,7 +257,7 @@ class FlatHashTableChunks {
} }
Iterator find(const KeyT &key) { Iterator find(const KeyT &key) {
if (empty() || is_key_empty(key)) { if (empty() || is_hash_table_key_empty(key)) {
return end(); return end();
} }
const auto hash = calc_hash(key); const auto hash = calc_hash(key);
@ -326,7 +326,7 @@ class FlatHashTableChunks {
template <class... ArgsT> template <class... ArgsT>
std::pair<Iterator, bool> emplace(KeyT key, ArgsT &&...args) { std::pair<Iterator, bool> emplace(KeyT key, ArgsT &&...args) {
CHECK(!is_key_empty(key)); CHECK(!is_hash_table_key_empty(key));
auto it = find(key); auto it = find(key);
if (it != end()) { if (it != end()) {
return {it, false}; return {it, false};

View File

@ -200,7 +200,7 @@ class FlatHashTable {
} }
Iterator find(const KeyT &key) { 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(); return end();
} }
auto bucket = calc_bucket(key); auto bucket = calc_bucket(key);
@ -265,7 +265,7 @@ class FlatHashTable {
template <class... ArgsT> template <class... ArgsT>
std::pair<Iterator, bool> emplace(KeyT key, ArgsT &&...args) { std::pair<Iterator, bool> emplace(KeyT key, ArgsT &&...args) {
try_grow(); try_grow();
CHECK(!is_key_empty(key)); CHECK(!is_hash_table_key_empty(key));
auto bucket = calc_bucket(key); auto bucket = calc_bucket(key);
while (true) { while (true) {
auto &node = nodes_[bucket]; auto &node = nodes_[bucket];

View File

@ -11,7 +11,7 @@
namespace td { namespace td {
template <class KeyT> template <class KeyT>
bool is_key_empty(const KeyT &key) { bool is_hash_table_key_empty(const KeyT &key) {
return key == KeyT(); return key == KeyT();
} }

View File

@ -65,7 +65,7 @@ struct MapNode {
} }
bool empty() const { bool empty() const {
return is_key_empty(first); return is_hash_table_key_empty(first);
} }
void clear() { void clear() {

View File

@ -50,7 +50,7 @@ struct SetNode {
} }
bool empty() const { bool empty() const {
return is_key_empty(first); return is_hash_table_key_empty(first);
} }
void clear() { void clear() {