From a34df221bbcccc8f39991e1713efba72382ec806 Mon Sep 17 00:00:00 2001 From: Andrea Vaccaro Date: Sun, 11 Oct 2026 12:34:25 +0200 Subject: [PATCH] value from ptr is never modified --- lib/std/hash_map.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/std/hash_map.zig b/lib/std/hash_map.zig index 1eafbbac83409703b0f38a2fd040840957f31e91..b55396eb0b9340ece86dbe5cd593dda402d171ac 100644 --- a/lib/std/hash_map.zig +++ b/lib/std/hash_map.zig @@ -434,7 +434,7 @@ pub fn HashMap( /// /// TODO: answer the question in these doc comments, does this /// increase the unused capacity by one? - pub fn removeByPtr(self: *Self, key_ptr: *K) void { + pub fn removeByPtr(self: *Self, key_ptr: *const K) void { self.unmanaged.removeByPtr(key_ptr); } @@ -1269,7 +1269,7 @@ fn Custom( /// /// TODO: answer the question in these doc comments, does this /// increase the unused capacity by one? - pub fn removeByPtr(self: *Self, key_ptr: *K) void { + pub fn removeByPtr(self: *Self, key_ptr: *const K) void { // if @sizeOf(K) == 0 then there is at most one item in the hash // map, which is assumed to exist as key_ptr must be valid. This // item must be at index 0. -- 2.54.0