]> git.eshelyaron.com Git - emacs.git/commit
itree.c (check_tree): Simplify
authorStefan Monnier <monnier@iro.umontreal.ca>
Tue, 11 Oct 2022 15:17:44 +0000 (11:17 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Tue, 11 Oct 2022 15:17:44 +0000 (11:17 -0400)
commit12836db6e4e09378d41301b3d4e1fcff58132d3a
tree0a49a20b0ca6cfa602571620aa2e1970f42328ee
parentda0387f0fe79f577fae6d5453c758f600e1ae495
itree.c (check_tree): Simplify

* src/itree.c (struct check_subtree_result): Remove `complete`.
(check_subtree): Remove `max_depth` arg (and adjust callers).
Use 0 as black-depth of empty tree.
Remove redundant `node->parent` check (already performed by the caller).
(check_tree): Replace with `check_tree_common` (update all callers).
Check the root's `parent` field.
(check_tree_no_rb): Delete function, inlined in its sole caller.
(interval_tree_remove): Add call to `check_tree` (without RB checks)
before `interval_tree_remove_fix`.  Move update of `size`
field accordingly.
src/itree.c