AK: Update HashTables head and tail when shifting during deletion

Otherwise we end up with invalid pointers to them, breaking iteration.
This commit is contained in:
Hediadyoin1 2023-02-21 11:27:29 +01:00 committed by Jelle Raaijmakers
parent 2ca8cf49ca
commit 93945062a7

View file

@ -654,8 +654,12 @@ private:
if constexpr (IsOrdered) {
if (bucket->previous)
bucket->previous->next = bucket;
else
m_collection_data.head = bucket;
if (bucket->next)
bucket->next->previous = bucket;
else
m_collection_data.tail = bucket;
}
};