From b698a0bc25e53e741ff59002f0671e0912c33292 Mon Sep 17 00:00:00 2001 From: Nathan Folsom Date: Fri, 29 Dec 2023 16:20:35 -0800 Subject: [PATCH] rename for clarity --- crates/fj-core/src/validate/references.rs | 12 ++++++++---- crates/fj-core/src/validate/sketch.rs | 4 ++-- crates/fj-core/src/validate/solid.rs | 9 +++++---- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/crates/fj-core/src/validate/references.rs b/crates/fj-core/src/validate/references.rs index 52a95c8889..fd9074940c 100644 --- a/crates/fj-core/src/validate/references.rs +++ b/crates/fj-core/src/validate/references.rs @@ -12,11 +12,15 @@ impl ReferenceCounter { Self(HashMap::new()) } - pub fn add_count(&mut self, object: Handle, found: Handle) { + pub fn add_reference( + &mut self, + referenced: Handle, + reference: Handle, + ) { self.0 - .entry(object) - .and_modify(|references| references.push(found.clone())) - .or_insert(vec![found]); + .entry(referenced) + .and_modify(|references| references.push(reference.clone())) + .or_insert(vec![reference]); } pub fn get_multiples(&self) -> Vec> { diff --git a/crates/fj-core/src/validate/sketch.rs b/crates/fj-core/src/validate/sketch.rs index a7872cdf7b..f50d75cf52 100644 --- a/crates/fj-core/src/validate/sketch.rs +++ b/crates/fj-core/src/validate/sketch.rs @@ -42,9 +42,9 @@ impl SketchValidationError { sketch.regions().iter().for_each(|r| { r.all_cycles().for_each(|c| { - referenced_cycles.add_count(c.clone(), r.clone()); + referenced_cycles.add_reference(c.clone(), r.clone()); c.half_edges().into_iter().for_each(|e| { - referenced_edges.add_count(e.clone(), c.clone()); + referenced_edges.add_reference(e.clone(), c.clone()); }) }) }); diff --git a/crates/fj-core/src/validate/solid.rs b/crates/fj-core/src/validate/solid.rs index cf5e9a48c3..1c8f2dbae0 100644 --- a/crates/fj-core/src/validate/solid.rs +++ b/crates/fj-core/src/validate/solid.rs @@ -151,12 +151,13 @@ impl SolidValidationError { solid.shells().iter().for_each(|s| { s.faces().into_iter().for_each(|f| { - referenced_faces.add_count(f.clone(), s.clone()); - referenced_regions.add_count(f.region().clone(), f.clone()); + referenced_faces.add_reference(f.clone(), s.clone()); + referenced_regions.add_reference(f.region().clone(), f.clone()); f.region().all_cycles().for_each(|c| { - referenced_cycles.add_count(c.clone(), f.region().clone()); + referenced_cycles + .add_reference(c.clone(), f.region().clone()); c.half_edges().into_iter().for_each(|e| { - referenced_edges.add_count(e.clone(), c.clone()); + referenced_edges.add_reference(e.clone(), c.clone()); }) }) })