authorgravatar for git@zander.xyzZander Khan <git@zander.xyz> 2021-01-16 17:52:14+00:00
committergravatar for git@zander.xyzZander Khan <git@zander.xyz> 2021-01-16 17:52:14+00:00
loga162a2194744ed9d9c095f0160e463a7a1b4e36c
tree66efbb637f0233b999d8c8de084a451740df98ef
parentecee1cae454ad5924f4698caaa712348858d9179

Ensure we cannot remove an item outside the current length of the queue


1 files changed, 1 insertions(+), 0 deletions(-)

lib/std/priority_dequeue.zig+1
...@@ -191,6 +191,7 @@ pub fn PriorityDequeue(comptime T: type) type {...@@ -191,6 +191,7 @@ pub fn PriorityDequeue(comptime T: type) type {
191 /// same order as iterator, which is not necessarily priority191 /// same order as iterator, which is not necessarily priority
192 /// order.192 /// order.
193 pub fn removeIndex(self: *Self, index: usize) T {193 pub fn removeIndex(self: *Self, index: usize) T {
194 assert(self.len > index);
194 const item = self.items[index];195 const item = self.items[index];
195 const last = self.items[self.len - 1];196 const last = self.items[self.len - 1];
196197