From ac25a41f77159f5c92bc4031ec7439bf559646c6 Mon Sep 17 00:00:00 2001 From: Robert Garrett Date: Thu, 11 Jul 2024 14:13:07 -0500 Subject: [PATCH] Fix: off-by-one in the boid count enumeration `enumerate()` begins counting at 0, so I was dividing the sum by one less than the count of boids. Thus the over-expanded result. I should do unit testing. I should rewrite this function to take the vector directly. I *know* that the input is a vector at all times. Mmh. --- src/birdoids_plugin.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/birdoids_plugin.rs b/src/birdoids_plugin.rs index d35ffc74..b694ee85 100644 --- a/src/birdoids_plugin.rs +++ b/src/birdoids_plugin.rs @@ -226,8 +226,8 @@ pub(crate) fn center_of_boids(points: impl Iterator) -> Option