Skip to content

Commit

Permalink
Save unnecessary allocation
Browse files Browse the repository at this point in the history
  • Loading branch information
hannobraun committed Jun 21, 2024
1 parent 1da0f6a commit 3dc3293
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions crates/fj-core/src/algorithms/approx/half_edge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
//!
//! See [`HalfEdgeApprox`].
use std::iter;

use crate::{
geometry::Geometry,
storage::Handle,
Expand Down Expand Up @@ -48,11 +50,8 @@ impl Approx for (&Handle<HalfEdge>, &Handle<Surface>) {
geometry,
);

let mut points = vec![start];
points.extend(rest.points);

let points = points
.into_iter()
let points = iter::once(start)
.chain(rest.points)
.map(|point| {
let point_surface = geometry
.of_curve(half_edge.curve())
Expand Down

0 comments on commit 3dc3293

Please sign in to comment.