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(...@@ -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.