diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2023-02-18 09:02:57 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2023-02-18 19:17:21 -0700 |
| commit | aeaef8c0ffadab4145fd002f2edd87a6db66ebd1 (patch) | |
| tree | e4c76c76173e5e72bc1947e1886662c4c6b2ba3c /lib/std/bounded_array.zig | |
| parent | f0530385b57218ef323747bdb7438330a07d25cc (diff) | |
| download | zig-aeaef8c0ffadab4145fd002f2edd87a6db66ebd1.tar.gz zig-aeaef8c0ffadab4145fd002f2edd87a6db66ebd1.zip | |
update std lib and compiler sources to new for loop syntax
Diffstat (limited to 'lib/std/bounded_array.zig')
| -rw-r--r-- | lib/std/bounded_array.zig | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/std/bounded_array.zig b/lib/std/bounded_array.zig index 7f1957d6dc..5242470631 100644 --- a/lib/std/bounded_array.zig +++ b/lib/std/bounded_array.zig @@ -169,7 +169,7 @@ pub fn BoundedArray(comptime T: type, comptime buffer_capacity: usize) type { } else { mem.copy(T, range, new_items); const after_subrange = start + new_items.len; - for (self.constSlice()[after_range..]) |item, i| { + for (self.constSlice()[after_range..], 0..) |item, i| { self.slice()[after_subrange..][i] = item; } self.len -= len - new_items.len; @@ -197,7 +197,7 @@ pub fn BoundedArray(comptime T: type, comptime buffer_capacity: usize) type { const newlen = self.len - 1; if (newlen == i) return self.pop(); const old_item = self.get(i); - for (self.slice()[i..newlen]) |*b, j| b.* = self.get(i + 1 + j); + for (self.slice()[i..newlen], 0..) |*b, j| b.* = self.get(i + 1 + j); self.set(newlen, undefined); self.len = newlen; return old_item; |
