Cosmetic change: remove redundant functions from FixedHashTable

This commit is contained in:
Alexander Kuzmenkov 2019-09-06 17:47:12 +03:00
parent 6f1a8c37ab
commit 05095111a1

View File

@ -262,8 +262,8 @@ public:
iterator end() { return iterator(this, buf + BUFFER_SIZE); } iterator end() { return iterator(this, buf + BUFFER_SIZE); }
protected: public:
void ALWAYS_INLINE emplaceImpl(Key x, iterator & it, bool & inserted) void ALWAYS_INLINE emplace(Key x, iterator & it, bool & inserted, size_t /* hash */ = 0)
{ {
it = iterator(this, &buf[x]); it = iterator(this, &buf[x]);
@ -278,22 +278,16 @@ protected:
++m_size; ++m_size;
} }
public:
std::pair<iterator, bool> ALWAYS_INLINE insert(const value_type & x) std::pair<iterator, bool> ALWAYS_INLINE insert(const value_type & x)
{ {
std::pair<iterator, bool> res; std::pair<iterator, bool> res;
emplaceImpl(Cell::getKey(x), res.first, res.second); emplace(Cell::getKey(x), res.first, res.second);
if (res.second) if (res.second)
res.first.ptr->setMapped(x); res.first.ptr->setMapped(x);
return res; 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) iterator ALWAYS_INLINE find(Key x)
{ {
return !buf[x].isZero(*this) ? iterator(this, &buf[x]) : end(); return !buf[x].isZero(*this) ? iterator(this, &buf[x]) : end();