From c8730dab98a7314e101ea09718e6cfb9994fda7a Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Tue, 3 Nov 2026 21:54:57 +0000 Subject: [PATCH] address review: charge empty curves only in snap_ends search --- crates/geom/src/region.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/geom/src/region.rs b/crates/geom/src/region.rs index 085556525..cb5d57877 100644 --- a/crates/geom/src/region.rs +++ b/crates/geom/src/region.rs @@ -479,7 +479,9 @@ fn nearest_curve(polys: &[Vec], i: usize, e: Vec2, snap: f64, tol: f64, bu continue; } // A curve with no segment costs a visit too, so many of them can't multiply the searches. - *budget = budget.checked_sub(1).ok_or(())?; + if other.len() < 2 { + *budget = budget.checked_sub(1).ok_or(())?; + } for (k, w) in other.windows(2).enumerate() { if *budget == 0 { return Err(());