Ensure we cannot remove an item outside the current length of the queue
This commit is contained in:
@@ -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];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user