| ... | @@ -508,7 +508,7 @@ pub fn HashMap( | ... | @@ -508,7 +508,7 @@ pub fn HashMap( |
| 508 | /// If a new entry needs to be stored, this function asserts there | 508 | /// If a new entry needs to be stored, this function asserts there |
| 509 | /// is enough capacity to store it. | 509 | /// is enough capacity to store it. |
| 510 | pub fn getOrPutAssumeCapacityAdapted(self: *Self, key: anytype, ctx: anytype) GetOrPutResult { | 510 | pub fn getOrPutAssumeCapacityAdapted(self: *Self, key: anytype, ctx: anytype) GetOrPutResult { |
| 511 | return self.unmanaged.getOrPutAssumeCapacityAdapted(self.allocator, key, ctx); | 511 | return self.unmanaged.getOrPutAssumeCapacityAdapted(key, ctx); |
| 512 | } | 512 | } |
| 513 | | 513 | |
| 514 | pub fn getOrPutValue(self: *Self, key: K, value: V) Allocator.Error!Entry { | 514 | pub fn getOrPutValue(self: *Self, key: K, value: V) Allocator.Error!Entry { |
| ... | @@ -2130,7 +2130,7 @@ test "std.hash_map getOrPutAdapted" { | ... | @@ -2130,7 +2130,7 @@ test "std.hash_map getOrPutAdapted" { |
| 2130 | try testing.expectEqual(map.count(), keys.len); | 2130 | try testing.expectEqual(map.count(), keys.len); |
| 2131 | | 2131 | |
| 2132 | inline for (keys, 0..) |key_str, i| { | 2132 | inline for (keys, 0..) |key_str, i| { |
| 2133 | const result = try map.getOrPutAdapted(key_str, AdaptedContext{}); | 2133 | const result = map.getOrPutAssumeCapacityAdapted(key_str, AdaptedContext{}); |
| 2134 | try testing.expect(result.found_existing); | 2134 | try testing.expect(result.found_existing); |
| 2135 | try testing.expectEqual(real_keys[i], result.key_ptr.*); | 2135 | try testing.expectEqual(real_keys[i], result.key_ptr.*); |
| 2136 | try testing.expectEqual(@as(u64, i) * 2, result.value_ptr.*); | 2136 | try testing.expectEqual(@as(u64, i) * 2, result.value_ptr.*); |