Skip to content

Commit

Permalink
sawy dywan
Browse files Browse the repository at this point in the history
  • Loading branch information
probably-neb committed May 26, 2024
1 parent 77bdb2c commit 5ba3612
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/ir/ir_phi.zig
Original file line number Diff line number Diff line change
Expand Up @@ -2381,12 +2381,13 @@ pub fn OrderedList(comptime T: type) type {
}

pub fn orderedRemove(self: *Self, idx: u32) T {
const actual = self.order.items[idx];
utils.assert(actual != Self.UNDEF, "tried to remove removed element in ordered list {d}\n", .{idx});
self.order.items[idx] = Self.UNDEF;
const val = self.list.orderedRemove(actual);
if (actual + 1 < self.len) {
for (self.order.items[idx + 1 ..]) |*i| {
const val = self.list.orderedRemove(idx);
for (self.order.items) |*i| {
if (i.* == idx) {
i.* = Self.UNDEF;
continue;
}
if (i.* > idx) {
i.* -= 1;
}
}
Expand Down

0 comments on commit 5ba3612

Please sign in to comment.