]> git.eshelyaron.com Git - emacs.git/commit
itree.c: Remove `tree` field from iterator
authorStefan Monnier <monnier@iro.umontreal.ca>
Sun, 2 Oct 2022 15:11:57 +0000 (11:11 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Sun, 2 Oct 2022 15:11:57 +0000 (11:11 -0400)
commitba5fe8e7895a2cbfd2d666ca88c0ed96a73fbe29
tree86ef32619bf43d7636281a565d6168a3025ee60f
parentc3eb6c0563cc95b2134af9fe0ee6f304ddbb0480
itree.c: Remove `tree` field from iterator

* src/itree.c (interval_generator_ensure_space, interval_generator_reset):
Inline and then delete functions.
(interval_tree_inherit_offset): Only take the tree's `otick` as arg.
Update all callers.
(struct interval_generator): Remove `tree` field, replace with a copy
of the tree's `otick`.
(interval_stack_push_flagged): The arg should be a real node.
(interval_tree_insert_gap): Prefer checking root==NULL rather than size==0.
Skip loop when tree is empty to avoid pushing&processing the NULL node.
(interval_tree_inherit_offset): Prefer parent==NULL rather than
node==root to avoid accessing the tree object.
src/itree.c