Skip to content

Commit

Permalink
Merge pull request ClickHouse#6846 from yandex/aku/fixed-hash-table
Browse files Browse the repository at this point in the history
Cosmetic change: remove redundant functions from FixedHashTable
  • Loading branch information
alexey-milovidov authored Sep 6, 2019
2 parents c90dfc1 + 71ed947 commit 2ffc99b
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions dbms/src/Common/HashTable/FixedHashTable.h
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,9 @@ class FixedHashTable : private boost::noncopyable, protected Allocator, protecte
iterator end() { return iterator(this, buf + BUFFER_SIZE); }


protected:
void ALWAYS_INLINE emplaceImpl(Key x, iterator & it, bool & inserted)
public:
/// The last parameter is unused but exists for compatibility with HashTable interface.
void ALWAYS_INLINE emplace(Key x, iterator & it, bool & inserted, size_t /* hash */ = 0)
{
it = iterator(this, &buf[x]);

Expand All @@ -278,22 +279,16 @@ class FixedHashTable : private boost::noncopyable, protected Allocator, protecte
++m_size;
}


public:
std::pair<iterator, bool> ALWAYS_INLINE insert(const value_type & x)
{
std::pair<iterator, bool> res;
emplaceImpl(Cell::getKey(x), res.first, res.second);
emplace(Cell::getKey(x), res.first, res.second);
if (res.second)
res.first.ptr->setMapped(x);

return res;
}


void ALWAYS_INLINE emplace(Key x, iterator & it, bool & inserted) { emplaceImpl(x, it, inserted); }
void ALWAYS_INLINE emplace(Key x, iterator & it, bool & inserted, size_t) { emplaceImpl(x, it, inserted); }

iterator ALWAYS_INLINE find(Key x)
{
return !buf[x].isZero(*this) ? iterator(this, &buf[x]) : end();
Expand Down

0 comments on commit 2ffc99b

Please sign in to comment.