fix(wavl): do not recursively fixup after delete

Signed-off-by: Matej Focko <mfocko@redhat.com>
This commit is contained in:
Matej Focko 2022-05-07 15:43:02 +02:00
parent 2433928d36
commit 0882e6575d
Signed by: mfocko
GPG key ID: 7C47D46246790496

View file

@ -159,10 +159,6 @@ class WAVLTree(AVLTree[T]):
def _delete_rebalance( def _delete_rebalance(
self, node: Optional[Node[T]], parent: Optional[Node[T]] self, node: Optional[Node[T]], parent: Optional[Node[T]]
) -> None: ) -> None:
# FIXME: Do not go all the way up, just to the replaced nodes and then
# check if rank rule is broken.
while node or parent:
self.__delete_fixup(node, parent) self.__delete_fixup(node, parent)
node, parent = parent, (parent.parent if parent else None)
# endregion DeleteRebalance # endregion DeleteRebalance