mirror of
https://github.com/ziglang/zig.git
synced 2025-12-06 14:23:09 +00:00
Ensure we cannot remove an item outside the current length of the queue
This commit is contained in:
parent
ecee1cae45
commit
a162a21947
@ -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];
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user