From: Josh Bleecher Snyder Date: Thu, 17 Aug 2017 17:24:13 +0000 (-0700) Subject: runtime: tiny refactor in evacuate X-Git-Tag: go1.10beta1~1457 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=43d4c9f4f18cad9ac738e15e1721b8ef32c5e31c;p=gostls13.git runtime: tiny refactor in evacuate Since oldbucket == h.nevacuate, we can just increment h.nevacuate here. This removes oldbucket from scope, which will be useful shortly. Change-Id: I70f81ec3995f17845ebf5d77ccd20ea4338f23e6 Reviewed-on: https://go-review.googlesource.com/56932 Run-TryBot: Josh Bleecher Snyder Reviewed-by: Daniel Martí Reviewed-by: Avelino Reviewed-by: Keith Randall TryBot-Result: Gobot Gobot --- diff --git a/src/runtime/hashmap.go b/src/runtime/hashmap.go index f3434eb788..dcaab8c185 100644 --- a/src/runtime/hashmap.go +++ b/src/runtime/hashmap.go @@ -1140,7 +1140,7 @@ func evacuate(t *maptype, h *hmap, oldbucket uintptr) { // Advance evacuation mark if oldbucket == h.nevacuate { - h.nevacuate = oldbucket + 1 + h.nevacuate++ // Experiments suggest that 1024 is overkill by at least an order of magnitude. // Put it in there as a safeguard anyway, to ensure O(1) behavior. stop := h.nevacuate + 1024