diff --git a/src/Common/HashTable/FixedHashTable.h b/src/Common/HashTable/FixedHashTable.h index 7df90fd98b9..49675aaafbc 100644 --- a/src/Common/HashTable/FixedHashTable.h +++ b/src/Common/HashTable/FixedHashTable.h @@ -358,7 +358,7 @@ public: std::pair res; emplace(Cell::getKey(x), res.first, res.second); if (res.second) - insertSetMapped(res.first->getMapped(), x); + res.first->setMapped(x); return res; } diff --git a/src/Common/HashTable/HashTable.h b/src/Common/HashTable/HashTable.h index 0e8510d1c8d..a48cb8d49f2 100644 --- a/src/Common/HashTable/HashTable.h +++ b/src/Common/HashTable/HashTable.h @@ -117,7 +117,7 @@ inline bool bitEquals(T && a, T && b) * 3) Hash tables that store the key and do not have a "mapped" value, e.g. the normal HashTable. * GetKey returns the key, and GetMapped returns a zero void pointer. This simplifies generic * code that works with mapped values: it can overload on the return type of GetMapped(), and - * doesn't need other parameters. One example is insertSetMapped() function. + * doesn't need other parameters. One example is Cell::setMapped() function. * * 4) Hash tables that store both the key and the "mapped" value, e.g. HashMap. Both GetKey and * GetMapped are supported. @@ -216,17 +216,6 @@ struct HashTableCell }; -/** - * A helper function for HashTable::insert() to set the "mapped" value. - * Overloaded on the mapped type, does nothing if it's VoidMapped. - */ -template -void insertSetMapped(VoidMapped /* dest */, const ValueType & /* src */) {} - -template -void insertSetMapped(MappedType & dest, const ValueType & src) { dest = src.second; } - - /** Determines the size of the hash table, and when and how much it should be resized. * Has very small state (one UInt8) and useful for Set-s allocated in automatic memory (see uniqExact as an example). */ @@ -1046,7 +1035,7 @@ public: } if (res.second) - insertSetMapped(res.first->getMapped(), x); + res.first->setMapped(x); return res; } diff --git a/src/Common/HashTable/TwoLevelHashTable.h b/src/Common/HashTable/TwoLevelHashTable.h index bd4c4c366f2..a60655e4072 100644 --- a/src/Common/HashTable/TwoLevelHashTable.h +++ b/src/Common/HashTable/TwoLevelHashTable.h @@ -224,7 +224,7 @@ public: emplace(Cell::getKey(x), res.first, res.second, hash_value); if (res.second) - insertSetMapped(res.first->getMapped(), x); + res.first->setMapped(x); return res; }