aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/map_faststr.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/runtime/map_faststr.go')
-rw-r--r--src/runtime/map_faststr.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/runtime/map_faststr.go b/src/runtime/map_faststr.go
index 2d1ac762a8..0673dd39c8 100644
--- a/src/runtime/map_faststr.go
+++ b/src/runtime/map_faststr.go
@@ -255,6 +255,9 @@ bucketloop:
// already have a mapping for key. Update it.
inserti = i
insertb = b
+ // Overwrite existing key, so it can be garbage collected.
+ // The size is already guaranteed to be set correctly.
+ k.str = key.str
goto done
}
ovf := b.overflow(t)