From: Josh Bleecher Snyder Date: Wed, 7 Jun 2017 18:42:36 +0000 (-0700) Subject: runtime: use constants for map string key size X-Git-Tag: go1.10beta1~1699 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=dabc361847f1daa8dee430fc6cf29c52e6f644cc;p=gostls13.git runtime: use constants for map string key size It appears that this was just missed by accident in the original implementation. Change-Id: Id87147bcb7a685d624eac7034342a305ad644e7a Reviewed-on: https://go-review.googlesource.com/53891 Run-TryBot: Josh Bleecher Snyder TryBot-Result: Gobot Gobot Reviewed-by: Keith Randall Reviewed-by: Avelino --- diff --git a/src/runtime/hashmap_fast.go b/src/runtime/hashmap_fast.go index 67b9787909..6f21624d32 100644 --- a/src/runtime/hashmap_fast.go +++ b/src/runtime/hashmap_fast.go @@ -635,8 +635,8 @@ again: if b.tophash[i] != top { if b.tophash[i] == empty && inserti == nil { inserti = &b.tophash[i] - insertk = add(unsafe.Pointer(b), dataOffset+i*uintptr(t.keysize)) - val = add(unsafe.Pointer(b), dataOffset+bucketCnt*uintptr(t.keysize)+i*uintptr(t.valuesize)) + insertk = add(unsafe.Pointer(b), dataOffset+i*2*sys.PtrSize) + val = add(unsafe.Pointer(b), dataOffset+bucketCnt*2*sys.PtrSize+i*uintptr(t.valuesize)) } continue }