Commit a162a21947

Zander Khan <git@zander.xyz>
2021-01-16 18:52:14
Ensure we cannot remove an item outside the current length of the queue
1 parent ecee1ca
Changed files (1)
lib/std/priority_dequeue.zig
@@ -191,6 +191,7 @@ pub fn PriorityDequeue(comptime T: type) type {
         /// same order as iterator, which is not necessarily priority
         /// order.
         pub fn removeIndex(self: *Self, index: usize) T {
+            assert(self.len > index);
             const item = self.items[index];
             const last = self.items[self.len - 1];