aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJosh Bleecher Snyder <josharian@gmail.com>2017-08-21 09:51:35 -0700
committerJosh Bleecher Snyder <josharian@gmail.com>2017-08-23 13:49:29 +0000
commit61043d467115365dbbc0937510c9b91fa4a28f1d (patch)
tree7ced48dee1ee812f30ab4c2541f0a8836702528f /src
parentdad5d76e8fff6370f73748c7237b64bda0af13bd (diff)
downloadgo-61043d467115365dbbc0937510c9b91fa4a28f1d.tar.xz
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>
Diffstat (limited to 'src')
-rw-r--r--src/runtime/hashmap.go2
-rw-r--r--src/runtime/hashmap_fast.go6
2 files changed, 4 insertions, 4 deletions
diff --git a/src/runtime/hashmap.go b/src/runtime/hashmap.go
index 9456500f00..1cfa9070fb 100644
--- a/src/runtime/hashmap.go
+++ b/src/runtime/hashmap.go
@@ -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++ {
diff --git a/src/runtime/hashmap_fast.go b/src/runtime/hashmap_fast.go
index de52f2cc04..1d830cc8cf 100644
--- a/src/runtime/hashmap_fast.go
+++ b/src/runtime/hashmap_fast.go
@@ -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++ {