address review: charge empty curves only in snap_ends search

This commit is contained in:
Dylan M. Taylor
2026-11-03 21:54:57 +00:00
parent aaa5172ba2
commit c8730dab98
+3 -1
View File
@@ -479,7 +479,9 @@ fn nearest_curve(polys: &[Vec<Vec2>], 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(());