From 3ddfc9e1dd0864ceaac0e8d8264cc77836600e65 Mon Sep 17 00:00:00 2001 From: Jack Mao Date: Wed, 20 Nov 2019 07:15:15 +0000 Subject: [PATCH] fix warning from go vet --- murmur32.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/murmur32.go b/murmur32.go index 552976a..e3a6bee 100644 --- a/murmur32.go +++ b/murmur32.go @@ -115,13 +115,10 @@ func Sum32WithSeed(data []byte, seed uint32) uint32 { h1 := seed nblocks := len(data) / 4 - var p uintptr - if len(data) > 0 { - p = uintptr(unsafe.Pointer(&data[0])) - } - p1 := p + uintptr(4*nblocks) + p := 0 + p1 := p + 4*nblocks for ; p < p1; p += 4 { - k1 := *(*uint32)(unsafe.Pointer(p)) + k1 := *(*uint32)(unsafe.Pointer(&data[p])) k1 *= c1_32 k1 = bits.RotateLeft32(k1, 15)