From 787711881fefe14bb3d917601461e8d936917b64 Mon Sep 17 00:00:00 2001 From: Emily Schmidt Date: Thu, 26 Sep 2024 17:05:45 +0100 Subject: [PATCH] minor fixes in inc_refine crate --- inc_refine/src/lib.rs | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/inc_refine/src/lib.rs b/inc_refine/src/lib.rs index e57271f..80139d0 100644 --- a/inc_refine/src/lib.rs +++ b/inc_refine/src/lib.rs @@ -369,7 +369,7 @@ impl IncrementalRefinement { loop { counter -= 1; if counter == 0 { - panic!("unexpected loop in first_sibling_scan") + panic!("unexpected loop in first_sibling_update") } let enter = Self::enter_id(id); let prev_enter = if let Some(prev) = self.node[enter].prev { @@ -413,7 +413,7 @@ impl IncrementalRefinement { loop { counter -= 1; if counter == 0 { - panic!("unexpected loop in first_sibling_scan") + panic!("unexpected loop in first_in_leaf_run_scan") } if !self.is_leaf(id) { return id; @@ -453,7 +453,7 @@ impl IncrementalRefinement { loop { counter -= 1; if counter == 0 { - panic!("unexpected loop in first_sibling_scan") + panic!("unexpected loop in first_in_leaf_run_update") } if !self.is_leaf(id) { return; @@ -560,11 +560,6 @@ impl IncrementalRefinement { /// /// Panics when the given item is not currently tracked. pub fn is_root(&mut self, id: T) -> bool { - let enter = Self::enter_id(id); - let Some(node) = self.node.get(enter) else { panic!("item not present") }; - if node.next.is_none() { - panic!("item not present"); - } let first_sibling = self.first_sibling(id); self.node[Self::enter_id(first_sibling)].prev.is_none() } @@ -636,7 +631,7 @@ impl IncrementalRefinement { /// Make two items equivalent. /// - /// This will remove the ancestor item and insert it directly below the descendant item. + /// This will remove the ancestor item and insert it directly above the descendant item. /// /// Panics when either given item is not currently tracked or when neither of the given item is /// an ancestor of the other item. @@ -998,6 +993,7 @@ impl IncrementalRefinement { } if nodes_to_move.is_empty() { + self.tmp = nodes_to_move; return; }