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-12 11:16:34+02:00
log7aadd325d1efad3c6222a91c354d92994a7bf76e
tree571875c1fa31a3fa748df3c58da207c50ddc3eb1
parent40fd34fe7bd7b5c3fdbc2804f7b39bdf02d09aff

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(...@@ -434,7 +434,7 @@ pub fn HashMap(
434 ///434 ///
435 /// TODO: answer the question in these doc comments, does this435 /// TODO: answer the question in these doc comments, does this
436 /// increase the unused capacity by one?436 /// 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 {
438 self.unmanaged.removeByPtr(key_ptr);438 self.unmanaged.removeByPtr(key_ptr);
439 }439 }
440440
...@@ -1269,7 +1269,7 @@ fn Custom(...@@ -1269,7 +1269,7 @@ fn Custom(
1269 ///1269 ///
1270 /// TODO: answer the question in these doc comments, does this1270 /// TODO: answer the question in these doc comments, does this
1271 /// increase the unused capacity by one?1271 /// 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 {
1273 // if @sizeOf(K) == 0 then there is at most one item in the hash1273 // if @sizeOf(K) == 0 then there is at most one item in the hash
1274 // map, which is assumed to exist as key_ptr must be valid. This1274 // map, which is assumed to exist as key_ptr must be valid. This
1275 // item must be at index 0.1275 // item must be at index 0.