bugfix with array iterator remove
authorBrendan Hansen <brendan.f.hansen@gmail.com>
Thu, 31 Mar 2022 23:32:59 +0000 (18:32 -0500)
committerBrendan Hansen <brendan.f.hansen@gmail.com>
Thu, 31 Mar 2022 23:32:59 +0000 (18:32 -0500)
core/container/iter.onyx

index 024a38730d660eaced03510a7784c167964d059c..a2c6813da128d0b65fbcb82b204c6e5d0477081f 100644 (file)
@@ -535,6 +535,7 @@ from_array :: (arr: [] $T) -> Iterator(^T) {
         // been incremented by the time this element calls #remove.
         array :: package core.array
         array.delete(arr, current - 1);
+        current -= 1;
     }
 
     return .{