1
0
mirror of https://github.com/golang/go synced 2024-11-24 04:30:14 -07:00

runtime: use add in mapdelete*

This better matches the style of the rest of the runtime.

Change-Id: I6abb755df50eb3d9086678629c0d184177e1981f
Reviewed-on: https://go-review.googlesource.com/57610
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Martin Möhrmann <moehrmann@google.com>
This commit is contained in:
Josh Bleecher Snyder 2017-08-21 09:51:35 -07:00
parent dad5d76e8f
commit 61043d4671
2 changed files with 4 additions and 4 deletions

View File

@ -666,7 +666,7 @@ func mapdelete(t *maptype, h *hmap, key unsafe.Pointer) {
if h.growing() {
growWork(t, h, bucket)
}
b := (*bmap)(unsafe.Pointer(uintptr(h.buckets) + bucket*uintptr(t.bucketsize)))
b := (*bmap)(add(h.buckets, bucket*uintptr(t.bucketsize)))
top := tophash(hash)
for {
for i := uintptr(0); i < bucketCnt; i++ {

View File

@ -646,7 +646,7 @@ func mapdelete_fast32(t *maptype, h *hmap, key uint32) {
if h.growing() {
growWork(t, h, bucket)
}
b := (*bmap)(unsafe.Pointer(uintptr(h.buckets) + bucket*uintptr(t.bucketsize)))
b := (*bmap)(add(h.buckets, bucket*uintptr(t.bucketsize)))
top := tophash(hash)
for {
for i := uintptr(0); i < bucketCnt; i++ {
@ -698,7 +698,7 @@ func mapdelete_fast64(t *maptype, h *hmap, key uint64) {
if h.growing() {
growWork(t, h, bucket)
}
b := (*bmap)(unsafe.Pointer(uintptr(h.buckets) + bucket*uintptr(t.bucketsize)))
b := (*bmap)(add(h.buckets, bucket*uintptr(t.bucketsize)))
top := tophash(hash)
for {
for i := uintptr(0); i < bucketCnt; i++ {
@ -751,7 +751,7 @@ func mapdelete_faststr(t *maptype, h *hmap, ky string) {
if h.growing() {
growWork(t, h, bucket)
}
b := (*bmap)(unsafe.Pointer(uintptr(h.buckets) + bucket*uintptr(t.bucketsize)))
b := (*bmap)(add(h.buckets, bucket*uintptr(t.bucketsize)))
top := tophash(hash)
for {
for i := uintptr(0); i < bucketCnt; i++ {