mirror of
https://github.com/SerenityOS/serenity
synced 2024-07-22 10:36:24 +00:00
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:
parent
2ca8cf49ca
commit
93945062a7
|
@ -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;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue