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
|
/// same order as iterator, which is not necessarily priority
|
||||||
/// order.
|
/// order.
|
||||||
pub fn removeIndex(self: *Self, index: usize) T {
|
pub fn removeIndex(self: *Self, index: usize) T {
|
||||||
|
assert(self.len > index);
|
||||||
const item = self.items[index];
|
const item = self.items[index];
|
||||||
const last = self.items[self.len - 1];
|
const last = self.items[self.len - 1];
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user