From e31ba830ba5bb9e6bfb82d13914528adba0d15a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20H=C3=BCgel?= Date: Fri, 2 Dec 2022 10:03:05 +0000 Subject: [PATCH] Add preventative debug assert See https://github.com/georust/geo/pull/941#issuecomment-1332305431 --- geo/src/algorithm/simplify.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/geo/src/algorithm/simplify.rs b/geo/src/algorithm/simplify.rs index 265d16fa4b..9f1e029b30 100644 --- a/geo/src/algorithm/simplify.rs +++ b/geo/src/algorithm/simplify.rs @@ -83,6 +83,7 @@ where } }, ); + debug_assert_ne!(farthest_index, 0); if farthest_distance > *epsilon { // The farthest index was larger than epsilon, so we will recursively simplify subsegments