Merge pull request #6846 from yandex/aku/fixed-hash-table

Cosmetic change: remove redundant functions from FixedHashTable
This commit is contained in:
alexey-milovidov 2019-09-06 20:20:26 +03:00 committed by GitHub
commit 2ffc99b893
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -262,8 +262,9 @@ public:
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]);
@ -278,22 +279,16 @@ protected:
++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();