]> git.eshelyaron.com Git - emacs.git/commit
itree.c: Get rid of the trick using null->parent
authorStefan Monnier <monnier@iro.umontreal.ca>
Thu, 6 Oct 2022 03:52:01 +0000 (23:52 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Thu, 6 Oct 2022 03:52:01 +0000 (23:52 -0400)
commit8bd114b98a31a31c1091e937891b369a165add3a
tree91ab75bbb8f98e28762035857a3081fb986e2a2c
parenta1f1fdd291a708684262c2494eae5bba32857cd7
itree.c: Get rid of the trick using null->parent

* src/itree.c (interval_tree_remove_fix): Add a `parent` argument.
Change the loop so it always keeps both `node` and `parent` in sync,
thus avoiding the use of `node->parent` on the initial node (since
that one can be null).
(interval_tree_remove): Manually keep track of the `broken` node's
parent to pass it to `interval_tree_remove_fix`.
src/itree.c