]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: use constants for map string key size
authorJosh Bleecher Snyder <josharian@gmail.com>
Wed, 7 Jun 2017 18:42:36 +0000 (11:42 -0700)
committerJosh Bleecher Snyder <josharian@gmail.com>
Tue, 8 Aug 2017 19:50:13 +0000 (19:50 +0000)
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 <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Avelino <t@avelino.xxx>
src/runtime/hashmap_fast.go

index 67b978790989b05a3c262afc04bba7263d5e786f..6f21624d3212b5411612440498215ff8a815ade3 100644 (file)
@@ -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
                        }