authorgravatar for vaccaro.andrea45@gmail.comAndrea Vaccaro <vaccaro.andrea45@gmail.com> 2026-10-11 12:34:25+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-10-14 21:07:14+02:00
loga34df221bbcccc8f39991e1713efba72382ec806
treea573b5dde6981ece54ae6cbd96d31aa8a3cc0c02
parentfa5d54e74ccc6f8648bc52dfe2e9ef3b20841a88
signature Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

value from ptr is never modified


1 files changed, 2 insertions(+), 2 deletions(-)

lib/std/hash_map.zig+2-2
......@@ -434,7 +434,7 @@ pub fn HashMap(
434434 ///
435435 /// TODO: answer the question in these doc comments, does this
436436 /// increase the unused capacity by one?
437 pub fn removeByPtr(self: *Self, key_ptr: *K) void {
437 pub fn removeByPtr(self: *Self, key_ptr: *const K) void {
438438 self.unmanaged.removeByPtr(key_ptr);
439439 }
440440
......@@ -1269,7 +1269,7 @@ fn Custom(
12691269 ///
12701270 /// TODO: answer the question in these doc comments, does this
12711271 /// increase the unused capacity by one?
1272 pub fn removeByPtr(self: *Self, key_ptr: *K) void {
1272 pub fn removeByPtr(self: *Self, key_ptr: *const K) void {
12731273 // if @sizeOf(K) == 0 then there is at most one item in the hash
12741274 // map, which is assumed to exist as key_ptr must be valid. This
12751275 // item must be at index 0.