From dabc361847f1daa8dee430fc6cf29c52e6f644cc Mon Sep 17 00:00:00 2001 From: Josh Bleecher Snyder Date: Wed, 7 Jun 2017 11:42:36 -0700 Subject: [PATCH] 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 --- src/runtime/hashmap_fast.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 } -- 2.48.1