mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 08:27:45 +00:00
AK: Zero previous pointer *after* fixing the insertion list in HashTable
This commit is contained in:
parent
f03838fac8
commit
5bf84a5b0e
2 changed files with 10 additions and 1 deletions
|
@ -704,11 +704,11 @@ private:
|
||||||
bucket.previous->next = bucket.next;
|
bucket.previous->next = bucket.next;
|
||||||
else
|
else
|
||||||
m_collection_data.head = bucket.next;
|
m_collection_data.head = bucket.next;
|
||||||
bucket.previous = nullptr;
|
|
||||||
if (bucket.next)
|
if (bucket.next)
|
||||||
bucket.next->previous = bucket.previous;
|
bucket.next->previous = bucket.previous;
|
||||||
else
|
else
|
||||||
m_collection_data.tail = bucket.previous;
|
m_collection_data.tail = bucket.previous;
|
||||||
|
bucket.previous = nullptr;
|
||||||
bucket.next = nullptr;
|
bucket.next = nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -300,3 +300,12 @@ BENCHMARK_CASE(benchmark_thrashing)
|
||||||
table.remove(i);
|
table.remove(i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST_CASE(reinsertion)
|
||||||
|
{
|
||||||
|
OrderedHashTable<String> map;
|
||||||
|
map.set("ytidb::LAST_RESULT_ENTRY_KEY");
|
||||||
|
map.set("__sak");
|
||||||
|
map.remove("__sak");
|
||||||
|
map.set("__sak");
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue