diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2023-02-19 10:10:59 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-02-19 10:10:59 -0500 |
| commit | 0bb178bbb2451238a326c6e916ecf38fbc34cab1 (patch) | |
| tree | b2499481c929ba1497d6eef8b85cc46205f953ab /lib/std/hash_map.zig | |
| parent | 346ec15c5005e523c2a1d4b967ee7a4e5d1e9775 (diff) | |
| parent | 5fc6bbe71eeecb195d2cda2a2522e7fd04749d5b (diff) | |
| download | zig-0bb178bbb2451238a326c6e916ecf38fbc34cab1.tar.gz zig-0bb178bbb2451238a326c6e916ecf38fbc34cab1.zip | |
Merge pull request #14671 from ziglang/multi-object-for
implement multi-object for loops
Diffstat (limited to 'lib/std/hash_map.zig')
| -rw-r--r-- | lib/std/hash_map.zig | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/std/hash_map.zig b/lib/std/hash_map.zig index 05205e6f07..78fcf68b56 100644 --- a/lib/std/hash_map.zig +++ b/lib/std/hash_map.zig @@ -2119,7 +2119,7 @@ test "std.hash_map getOrPutAdapted" { var real_keys: [keys.len]u64 = undefined; - inline for (keys) |key_str, i| { + inline for (keys, 0..) |key_str, i| { const result = try map.getOrPutAdapted(key_str, AdaptedContext{}); try testing.expect(!result.found_existing); real_keys[i] = std.fmt.parseInt(u64, key_str, 10) catch unreachable; @@ -2129,7 +2129,7 @@ test "std.hash_map getOrPutAdapted" { try testing.expectEqual(map.count(), keys.len); - inline for (keys) |key_str, i| { + inline for (keys, 0..) |key_str, i| { const result = try map.getOrPutAdapted(key_str, AdaptedContext{}); try testing.expect(result.found_existing); try testing.expectEqual(real_keys[i], result.key_ptr.*); |
