From f4f79aa84a73397ef93331fc9432527fb367899f Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Sat, 3 Oct 2020 22:55:02 +0300 Subject: [PATCH] Add HashTable::reserve() (for preallocated hashed/sparse_hashed dictionaries) --- src/Common/HashTable/HashTable.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Common/HashTable/HashTable.h b/src/Common/HashTable/HashTable.h index baad5d40764..897c84fe951 100644 --- a/src/Common/HashTable/HashTable.h +++ b/src/Common/HashTable/HashTable.h @@ -850,6 +850,11 @@ protected: public: + void reserve(size_t num_elements) + { + resize(num_elements); + } + /// Insert a value. In the case of any more complex values, it is better to use the `emplace` function. std::pair ALWAYS_INLINE insert(const value_type & x) {