aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/hashmap.go
diff options
context:
space:
mode:
authorMatthew Dempsky <mdempsky@google.com>2016-02-29 15:01:00 -0800
committerMatthew Dempsky <mdempsky@google.com>2016-03-07 20:53:27 +0000
commita03bdc3e6bea34abd5077205371e6fb9ef354481 (patch)
tree305aea0c37fe51db90660eef9133e6254ebf864a /src/runtime/hashmap.go
parent1ec4f227f45f669dfcc017b1eb1d147aca5ac620 (diff)
downloadgo-a03bdc3e6bea34abd5077205371e6fb9ef354481.tar.xz
runtime: eliminate unnecessary type conversions
Automated refactoring produced using github.com/mdempsky/unconvert. Change-Id: Iacf871a4f221ef17f48999a464ab2858b2bbaa90 Reviewed-on: https://go-review.googlesource.com/20071 Reviewed-by: Austin Clements <austin@google.com> Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/runtime/hashmap.go')
-rw-r--r--src/runtime/hashmap.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/runtime/hashmap.go b/src/runtime/hashmap.go
index 6f7451e02c..80b2b5338c 100644
--- a/src/runtime/hashmap.go
+++ b/src/runtime/hashmap.go
@@ -188,7 +188,7 @@ func (h *hmap) createOverflow() {
// If h != nil, the map can be created directly in h.
// If bucket != nil, bucket can be used as the first bucket.
func makemap(t *maptype, hint int64, h *hmap, bucket unsafe.Pointer) *hmap {
- if sz := unsafe.Sizeof(hmap{}); sz > 48 || sz != uintptr(t.hmap.size) {
+ if sz := unsafe.Sizeof(hmap{}); sz > 48 || sz != t.hmap.size {
println("runtime: sizeof(hmap) =", sz, ", t.hmap.size =", t.hmap.size)
throw("bad hmap size")
}
@@ -220,10 +220,10 @@ func makemap(t *maptype, hint int64, h *hmap, bucket unsafe.Pointer) *hmap {
if t.elem.align > bucketCnt {
throw("value align too big")
}
- if uintptr(t.key.size)%uintptr(t.key.align) != 0 {
+ if t.key.size%uintptr(t.key.align) != 0 {
throw("key size not a multiple of key align")
}
- if uintptr(t.elem.size)%uintptr(t.elem.align) != 0 {
+ if t.elem.size%uintptr(t.elem.align) != 0 {
throw("value size not a multiple of value align")
}
if bucketCnt < 8 {