diff options
Diffstat (limited to 'src/internal/runtime/maps/runtime.go')
| -rw-r--r-- | src/internal/runtime/maps/runtime.go | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/internal/runtime/maps/runtime.go b/src/internal/runtime/maps/runtime.go index ff8a748249..8bba23f070 100644 --- a/src/internal/runtime/maps/runtime.go +++ b/src/internal/runtime/maps/runtime.go @@ -94,10 +94,11 @@ func runtime_mapaccess1(typ *abi.MapType, m *Map, key unsafe.Pointer) unsafe.Poi // Probe table. seq := makeProbeSeq(h1(hash), t.groups.lengthMask) + h2Hash := h2(hash) for ; ; seq = seq.next() { g := t.groups.group(typ, seq.offset) - match := g.ctrls().matchH2(h2(hash)) + match := g.ctrls().matchH2(h2Hash) for match != 0 { i := match.first() @@ -168,10 +169,11 @@ func runtime_mapaccess2(typ *abi.MapType, m *Map, key unsafe.Pointer) (unsafe.Po // Probe table. seq := makeProbeSeq(h1(hash), t.groups.lengthMask) + h2Hash := h2(hash) for ; ; seq = seq.next() { g := t.groups.group(typ, seq.offset) - match := g.ctrls().matchH2(h2(hash)) + match := g.ctrls().matchH2(h2Hash) for match != 0 { i := match.first() @@ -262,9 +264,10 @@ outer: var firstDeletedGroup groupReference var firstDeletedSlot uintptr + h2Hash := h2(hash) for ; ; seq = seq.next() { g := t.groups.group(typ, seq.offset) - match := g.ctrls().matchH2(h2(hash)) + match := g.ctrls().matchH2(h2Hash) // Look for an existing slot containing this key. for match != 0 { @@ -329,7 +332,7 @@ outer: slotElem = emem } - g.ctrls().set(i, ctrl(h2(hash))) + g.ctrls().set(i, ctrl(h2Hash)) t.growthLeft-- t.used++ m.used++ |
