]> Cypherpunks repositories - gostls13.git/commit
runtime: on map update, don't overwrite key if we don't need to.
authorKeith Randall <khr@golang.org>
Mon, 8 Jun 2015 15:42:28 +0000 (08:42 -0700)
committerKeith Randall <khr@golang.org>
Wed, 9 Sep 2015 21:06:49 +0000 (21:06 +0000)
commit00c638d243056b24f1deeb2d1d954e62baedd468
treedb1ccef72c501061e20db5eef66cb98c597ff94b
parentaf7c9a42c1112175650f5261a2363ca37eec3932
runtime: on map update, don't overwrite key if we don't need to.

Keep track of which types of keys need an update and which don't.

Strings need an update because the new key might pin a smaller backing store.
Floats need an update because it might be +0/-0.
Interfaces need an update because they may contain strings or floats.

Fixes #11088

Change-Id: I9ade53c1dfb3c1a2870d68d07201bc8128e9f217
Reviewed-on: https://go-review.googlesource.com/10843
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/cmd/compile/internal/gc/reflect.go
src/reflect/type.go
src/runtime/hashmap.go
src/runtime/type.go