mirror of
https://github.com/ziglang/zig.git
synced 2025-12-06 14:23:09 +00:00
removing redundant assert
This commit is contained in:
parent
778bb4b324
commit
84406d98e4
@ -196,7 +196,6 @@ pub fn PriorityQueue(comptime T: type) type {
|
|||||||
|
|
||||||
pub fn update(self: *Self, elem: T, new_elem: T) !void {
|
pub fn update(self: *Self, elem: T, new_elem: T) !void {
|
||||||
var update_index: usize = std.mem.indexOfScalar(T, self.items, elem) orelse return error.ElementNotFound;
|
var update_index: usize = std.mem.indexOfScalar(T, self.items, elem) orelse return error.ElementNotFound;
|
||||||
assert (update_index >= 0 and update_index < self.items.len);
|
|
||||||
const old_elem: T = self.items[update_index];
|
const old_elem: T = self.items[update_index];
|
||||||
self.items[update_index] = new_elem;
|
self.items[update_index] = new_elem;
|
||||||
if (self.compareFn(new_elem, old_elem)) {
|
if (self.compareFn(new_elem, old_elem)) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user