diff --git a/dbms/src/Common/HashTable/ClearableHashSet.h b/dbms/src/Common/HashTable/ClearableHashSet.h index b793d3ce099..e0939d43071 100644 --- a/dbms/src/Common/HashTable/ClearableHashSet.h +++ b/dbms/src/Common/HashTable/ClearableHashSet.h @@ -68,3 +68,23 @@ public: this->m_size = 0; } }; + +template +< + typename Key, + typename Hash = DefaultHash, + typename Grower = HashTableGrower<>, + typename Allocator = HashTableAllocator +> +class ClearableHashSetWithSavedHash: public HashTable>, Hash, Grower, Allocator> +{ +public: + using key_type = Key; + using value_type = typename ClearableHashSetWithSavedHash::cell_type::value_type; + + void clear() + { + ++this->version; + this->m_size = 0; + } +};