mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-25 17:12:03 +00:00
dbms: tiny modifications [#METR-2944].
This commit is contained in:
parent
70ee1bdaf6
commit
f360f244eb
@ -129,6 +129,8 @@ public:
|
||||
typedef typename Cell::Mapped mapped_type;
|
||||
typedef typename Cell::value_type value_type;
|
||||
|
||||
using HashTable<Key, Cell, Hash, Grower, Allocator>::HashTable;
|
||||
|
||||
mapped_type & operator[](Key x)
|
||||
{
|
||||
typename HashMapTable::iterator it;
|
||||
|
@ -240,7 +240,7 @@ protected:
|
||||
Grower grower;
|
||||
|
||||
#ifdef DBMS_HASH_MAP_COUNT_COLLISIONS
|
||||
mutable size_t collisions;
|
||||
mutable size_t collisions = 0;
|
||||
#endif
|
||||
|
||||
/// Найти ячейку с тем же ключём или пустую ячейку, начиная с заданного места и далее по цепочке разрешения коллизий.
|
||||
@ -372,10 +372,14 @@ public:
|
||||
if (Cell::need_zero_value_storage)
|
||||
this->zeroValue()->setZero();
|
||||
alloc(grower);
|
||||
}
|
||||
|
||||
#ifdef DBMS_HASH_MAP_COUNT_COLLISIONS
|
||||
collisions = 0;
|
||||
#endif
|
||||
HashTable(size_t reserve_for_num_elements)
|
||||
{
|
||||
if (Cell::need_zero_value_storage)
|
||||
this->zeroValue()->setZero();
|
||||
grower.set(reserve_for_num_elements);
|
||||
alloc(grower);
|
||||
}
|
||||
|
||||
~HashTable()
|
||||
|
Loading…
Reference in New Issue
Block a user