From b39c3ba09701a88c2613802a866beb4ee1ec581e Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Fri, 14 Oct 2022 14:54:34 +0200 Subject: [PATCH] Refactor --- crates/fj-kernel/src/partial/objects/cycle.rs | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/crates/fj-kernel/src/partial/objects/cycle.rs b/crates/fj-kernel/src/partial/objects/cycle.rs index 3b3167b70..bbb15c2c6 100644 --- a/crates/fj-kernel/src/partial/objects/cycle.rs +++ b/crates/fj-kernel/src/partial/objects/cycle.rs @@ -166,14 +166,7 @@ impl PartialCycle { let half_edges = { let (half_edges, _) = self.half_edges.into_iter().fold( (Vec::new(), None), - |(mut half_edges, previous), next| { - let previous_half_edge: Option = previous; - - let previous_vertex = previous_half_edge.map(|half_edge| { - let [_, vertex] = half_edge.vertices().clone(); - vertex.surface_form().clone() - }); - + |(mut half_edges, previous_vertex), next| { let next = next .update_partial(|half_edge| { let [from, _] = half_edge.vertices.clone(); @@ -189,9 +182,10 @@ impl PartialCycle { }) .into_full(objects); - half_edges.push(next.clone()); + let front = next.front().surface_form().clone(); + half_edges.push(next); - (half_edges, Some(next)) + (half_edges, Some(front)) }, );