From 721a8716d41453c46e89e136f487d11ebd570a2a Mon Sep 17 00:00:00 2001 From: Aaron Fenyes Date: Sat, 28 Sep 2024 18:49:17 -0700 Subject: [PATCH] Assembly: don't track element list when inserting Calling `try_insert_element` or `insert_new_element` in a responsive context shouldn't make the context track `elements_by_id`. --- app-proto/full-interface/src/assembly.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app-proto/full-interface/src/assembly.rs b/app-proto/full-interface/src/assembly.rs index 0660d0e..c0c9959 100644 --- a/app-proto/full-interface/src/assembly.rs +++ b/app-proto/full-interface/src/assembly.rs @@ -49,7 +49,7 @@ impl Assembly { } pub fn try_insert_element(&self, elt: Element) -> bool { - let can_insert = self.elements_by_id.with( + let can_insert = self.elements_by_id.with_untracked( |elts_by_id| !elts_by_id.contains_key(&elt.id) ); if can_insert { @@ -62,7 +62,7 @@ impl Assembly { // find the next unused identifier in the default sequence let mut id_num = 1; let mut id = format!("sphere{}", id_num); - while self.elements_by_id.with( + while self.elements_by_id.with_untracked( |elts_by_id| elts_by_id.contains_key(&id) ) { id_num += 1;