diff options
| author | Zander Khan <git@zander.xyz> | 2021-01-16 18:43:13 +0000 |
|---|---|---|
| committer | Zander Khan <git@zander.xyz> | 2021-01-16 18:43:13 +0000 |
| commit | e1ab425bcead727a73e4512aeca1ba9112b2c88e (patch) | |
| tree | a8ca372e937ab2d58f9aeba738fc77ad78437875 /lib/std/priority_dequeue.zig | |
| parent | c6986f29f94ee404ae3a3221449dc4af5599ca1f (diff) | |
| download | zig-e1ab425bcead727a73e4512aeca1ba9112b2c88e.tar.gz zig-e1ab425bcead727a73e4512aeca1ba9112b2c88e.zip | |
Fix slice length when updating
Diffstat (limited to 'lib/std/priority_dequeue.zig')
| -rw-r--r-- | lib/std/priority_dequeue.zig | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/std/priority_dequeue.zig b/lib/std/priority_dequeue.zig index 0d789bbdc8..9655458890 100644 --- a/lib/std/priority_dequeue.zig +++ b/lib/std/priority_dequeue.zig @@ -389,7 +389,7 @@ pub fn PriorityDequeue(comptime T: type) type { } pub fn update(self: *Self, elem: T, new_elem: T) !void { - var old_index: usize = std.mem.indexOfScalar(T, self.items[0 .. self.len - 1], elem) orelse return error.ElementNotFound; + var old_index: usize = std.mem.indexOfScalar(T, self.items[0..self.len], elem) orelse return error.ElementNotFound; _ = self.removeIndex(old_index); self.addUnchecked(new_elem); } |
