1
0
mirror of https://github.com/golang/go synced 2024-10-02 06:18:32 -06:00

runtime: simplify evacuate's handling of NaNs

The new code is not quite equivalent to the old,
in that if newbit was very large it might have altered the new tophash.
The old behavior is unnecessary and probably undesirable.

Change-Id: I7fb3222520cb61081a857adcddfbb9078ead7122
Reviewed-on: https://go-review.googlesource.com/56930
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
This commit is contained in:
Josh Bleecher Snyder 2017-08-17 17:41:44 -07:00
parent 1ba4556a2c
commit 8a9d4184e6

View File

@ -1086,15 +1086,12 @@ func evacuate(t *maptype, h *hmap, oldbucket uintptr) {
// We recompute a new random tophash for the next level so // We recompute a new random tophash for the next level so
// these keys will get evenly distributed across all buckets // these keys will get evenly distributed across all buckets
// after multiple grows. // after multiple grows.
if top&1 != 0 { useY = top & 1
hash |= newbit
} else {
hash &^= newbit
}
top = tophash(hash) top = tophash(hash)
} } else {
if hash&newbit != 0 { if hash&newbit != 0 {
useY = 1 useY = 1
}
} }
} }