From f0932600292174bb7513acb2cd0e184c294344ab Mon Sep 17 00:00:00 2001 From: Joe Date: Tue, 10 Feb 2026 00:38:49 -0600 Subject: [PATCH] Refactor instance path retrieval in snapshot.rs - Replaced the manual path construction logic in inst_path with a call to dom.full_path_of for improved efficiency and readability. --- src/syncback/snapshot.rs | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/src/syncback/snapshot.rs b/src/syncback/snapshot.rs index 220caa1f..954630a9 100644 --- a/src/syncback/snapshot.rs +++ b/src/syncback/snapshot.rs @@ -371,19 +371,7 @@ pub fn filter_out_property(inst: &Instance, prop_name: &str) -> bool { } pub fn inst_path(dom: &WeakDom, referent: Ref) -> String { - let mut path = Vec::new(); - - let mut inst = dom.get_by_ref(referent); - while let Some(instance) = inst { - path.push(instance.name.as_str()); - inst = dom.get_by_ref(instance.parent()); - } - // This is to avoid the root's name from appearing in the path. Not - // optimal, but should be fine. - path.pop(); - - path.reverse(); - path.join("/") + dom.full_path_of(referent, "/") } #[cfg(test)]