Fix failure to find expire during rehash

Former-commit-id: b66269865cb71a5e1dd33588b012206da2765824
This commit is contained in:
John Sully 2020-06-10 12:48:16 -04:00
parent ddde8abfc7
commit 4e609863b6

View File

@ -92,8 +92,8 @@ public:
for (int hashset = 0; hashset < 2; ++hashset) // rehashing may only be 1 resize behind, so we check up to two slots
{
if (m_data[itr.idxPrimary] == nullptr)
continue;
if (m_data[itr.idxPrimary] != nullptr)
{
const auto &vecBucket = *m_data[itr.idxPrimary];
auto itrFind = std::find(vecBucket.begin(), vecBucket.end(), key);
@ -102,6 +102,7 @@ public:
itr.idxSecondary = itrFind - vecBucket.begin();
return itr;
}
}
// See if we have to check the older slot
size_t mask = (hashmask() >> 1);
@ -333,7 +334,8 @@ private:
{
if (m_data[idxRehash] == nullptr)
continue;
CowPtr<vector_type> spvecT = std::make_shared<vector_type>();
CowPtr<vector_type> spvecT;
std::swap(m_data[idxRehash], spvecT);
for (const auto &v : *spvecT)