Skip to content

Commit

Permalink
refactor(core/tree): handle setting root to None in caller instead of…
Browse files Browse the repository at this point in the history
… helper
  • Loading branch information
aravinda0 committed Mar 6, 2024
1 parent 63a3946 commit bdd20c4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/qtile_bonsai/core/tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,8 @@ def remove(
br_rm, br_sib, br_rm_nodes = self._remove(
node, consume_vacant_space=True, normalize=normalize
)
if br_rm is self._root:
self._root = None

rm_nodes.extend(br_rm_nodes)
if br_sib is not None:
Expand Down Expand Up @@ -681,7 +683,6 @@ def _remove(
"""
br_rm, br_rm_nodes = self._find_removal_branch(node)
if br_rm is self._root:
self._root = None
return (br_rm, None, br_rm_nodes)

container = br_rm.parent
Expand Down

0 comments on commit bdd20c4

Please sign in to comment.