From 32ec9e986637cf84fa7b90be27765f509efea9fd Mon Sep 17 00:00:00 2001 From: Matej Focko Date: Sat, 7 May 2022 17:03:30 +0200 Subject: [PATCH] chore: remove debug statements Signed-off-by: Matej Focko --- avl.py | 1 - wavl.py | 11 ----------- 2 files changed, 12 deletions(-) diff --git a/avl.py b/avl.py index eda3a63..5a6c2b0 100644 --- a/avl.py +++ b/avl.py @@ -18,7 +18,6 @@ def _balance_factor(node: Optional[Node[T]]) -> int: def _update_rank(node: Node[T]) -> None: left, right = Node.get_rank(node.left), Node.get_rank(node.right) - # logger.debug(f"[_update_rank] on {node} = ({left}, {right})") node.rank = 1 + max(left, right) diff --git a/wavl.py b/wavl.py index 336555b..dcc28a0 100644 --- a/wavl.py +++ b/wavl.py @@ -46,14 +46,10 @@ class WAVLTree(AVLTree[T]): if reversed: v, w = w, v - logger.debug(f"__fix_delete({x}, {y}, {z}, {reversed})") - w_diff = Node.difference(w, y) - logger.debug(f"w_diff = {w_diff}") # assert v if w_diff == 1 and y.parent: - logger.debug(f"y.parent = {y.parent}") new_root = rotate_left(y.parent) if rotating_around_root: self.root = new_root @@ -64,7 +60,6 @@ class WAVLTree(AVLTree[T]): if z.type == NodeType.LEAF: z.demote() elif w_diff == 2 and v and v.parent: - logger.debug(f"v.parent = {v.parent}") rotate_right(v.parent) new_root = rotate_left(v.parent) if rotating_around_root: @@ -136,8 +131,6 @@ class WAVLTree(AVLTree[T]): def __delete_fixup( self, y: Optional[Node[T]], parent: Optional[Node[T]] = None ) -> None: - logger.debug(f"[__delete_fixup] y = {y}, parent = {parent}") - if Node.differences(y) == (2, 2): y.demote() parent = y.parent @@ -149,10 +142,6 @@ class WAVLTree(AVLTree[T]): return for y in (parent.left, parent.right): - logger.debug( - f"[bottom-up delete] Node.difference({y}, {parent}) == 3" - f"~>* {Node.difference(y, parent)} == 3" - ) if Node.difference(y, parent) == 3: self.__bottomup_delete(y, parent)