chore: remove debug statements

Signed-off-by: Matej Focko <mfocko@redhat.com>
This commit is contained in:
Matej Focko 2022-05-07 17:03:30 +02:00
parent 0882e6575d
commit 32ec9e9866
Signed by: mfocko
GPG key ID: 7C47D46246790496
2 changed files with 0 additions and 12 deletions

1
avl.py
View file

@ -18,7 +18,6 @@ def _balance_factor(node: Optional[Node[T]]) -> int:
def _update_rank(node: Node[T]) -> None: def _update_rank(node: Node[T]) -> None:
left, right = Node.get_rank(node.left), Node.get_rank(node.right) 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) node.rank = 1 + max(left, right)

11
wavl.py
View file

@ -46,14 +46,10 @@ class WAVLTree(AVLTree[T]):
if reversed: if reversed:
v, w = w, v v, w = w, v
logger.debug(f"__fix_delete({x}, {y}, {z}, {reversed})")
w_diff = Node.difference(w, y) w_diff = Node.difference(w, y)
logger.debug(f"w_diff = {w_diff}")
# assert v # assert v
if w_diff == 1 and y.parent: if w_diff == 1 and y.parent:
logger.debug(f"y.parent = {y.parent}")
new_root = rotate_left(y.parent) new_root = rotate_left(y.parent)
if rotating_around_root: if rotating_around_root:
self.root = new_root self.root = new_root
@ -64,7 +60,6 @@ class WAVLTree(AVLTree[T]):
if z.type == NodeType.LEAF: if z.type == NodeType.LEAF:
z.demote() z.demote()
elif w_diff == 2 and v and v.parent: elif w_diff == 2 and v and v.parent:
logger.debug(f"v.parent = {v.parent}")
rotate_right(v.parent) rotate_right(v.parent)
new_root = rotate_left(v.parent) new_root = rotate_left(v.parent)
if rotating_around_root: if rotating_around_root:
@ -136,8 +131,6 @@ class WAVLTree(AVLTree[T]):
def __delete_fixup( def __delete_fixup(
self, y: Optional[Node[T]], parent: Optional[Node[T]] = None self, y: Optional[Node[T]], parent: Optional[Node[T]] = None
) -> None: ) -> None:
logger.debug(f"[__delete_fixup] y = {y}, parent = {parent}")
if Node.differences(y) == (2, 2): if Node.differences(y) == (2, 2):
y.demote() y.demote()
parent = y.parent parent = y.parent
@ -149,10 +142,6 @@ class WAVLTree(AVLTree[T]):
return return
for y in (parent.left, parent.right): 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: if Node.difference(y, parent) == 3:
self.__bottomup_delete(y, parent) self.__bottomup_delete(y, parent)