dbms: tiny modifications [#METR-2944].

This commit is contained in:
Alexey Milovidov 2014-12-25 03:19:29 +03:00
parent 70ee1bdaf6
commit f360f244eb
2 changed files with 10 additions and 4 deletions

View File

@ -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;

View File

@ -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()