From 58cda59b780c07760473516ad6b27532a53ae00c Mon Sep 17 00:00:00 2001 From: Jarrod Doyle Date: Fri, 22 Sep 2023 21:33:04 +0100 Subject: [PATCH] Simplify merge vertices function --- csg/src/brush.rs | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/csg/src/brush.rs b/csg/src/brush.rs index aa526fd..cb26afa 100644 --- a/csg/src/brush.rs +++ b/csg/src/brush.rs @@ -117,14 +117,7 @@ impl Brush { let mut vs: Vec = vec![]; for intersection in &self.raw_vertices { let point = intersection.get_intersection_point(); - let mut duplicate = false; - for v in &vs { - if v.abs_diff_eq(point, math::EPSILON) { - duplicate = true; - break; - } - } - if !duplicate { + if !vs.iter().any(|v| v.abs_diff_eq(point, math::EPSILON)) { vs.push(point); } }