mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 12:07:45 +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
1 changed files with 4 additions and 0 deletions
|
@ -654,8 +654,12 @@ private:
|
||||||
if constexpr (IsOrdered) {
|
if constexpr (IsOrdered) {
|
||||||
if (bucket->previous)
|
if (bucket->previous)
|
||||||
bucket->previous->next = bucket;
|
bucket->previous->next = bucket;
|
||||||
|
else
|
||||||
|
m_collection_data.head = bucket;
|
||||||
if (bucket->next)
|
if (bucket->next)
|
||||||
bucket->next->previous = bucket;
|
bucket->next->previous = bucket;
|
||||||
|
else
|
||||||
|
m_collection_data.tail = bucket;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue