mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 13:54:21 +00:00
hash map: remove extra argument
This commit is contained in:
parent
064b355912
commit
1a1598daf0
1 changed files with 2 additions and 2 deletions
|
|
@ -508,7 +508,7 @@ pub fn HashMap(
|
|||
/// If a new entry needs to be stored, this function asserts there
|
||||
/// is enough capacity to store it.
|
||||
pub fn getOrPutAssumeCapacityAdapted(self: *Self, key: anytype, ctx: anytype) GetOrPutResult {
|
||||
return self.unmanaged.getOrPutAssumeCapacityAdapted(self.allocator, key, ctx);
|
||||
return self.unmanaged.getOrPutAssumeCapacityAdapted(key, ctx);
|
||||
}
|
||||
|
||||
pub fn getOrPutValue(self: *Self, key: K, value: V) Allocator.Error!Entry {
|
||||
|
|
@ -2130,7 +2130,7 @@ test "std.hash_map getOrPutAdapted" {
|
|||
try testing.expectEqual(map.count(), keys.len);
|
||||
|
||||
inline for (keys, 0..) |key_str, i| {
|
||||
const result = try map.getOrPutAdapted(key_str, AdaptedContext{});
|
||||
const result = map.getOrPutAssumeCapacityAdapted(key_str, AdaptedContext{});
|
||||
try testing.expect(result.found_existing);
|
||||
try testing.expectEqual(real_keys[i], result.key_ptr.*);
|
||||
try testing.expectEqual(@as(u64, i) * 2, result.value_ptr.*);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue