diff --git a/lib/std/priority_dequeue.zig b/lib/std/priority_dequeue.zig index 5dd861bcbd..540f37960a 100644 --- a/lib/std/priority_dequeue.zig +++ b/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];