diff options
| author | Jes Cok <xigua67damn@gmail.com> | 2023-09-15 21:15:56 +0000 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2023-09-18 20:01:34 +0000 |
| commit | f4e7675d1150cb683f3d2db7a96084b0d6e26e83 (patch) | |
| tree | 340df6f82a5795fd470b3a0dc97b807178f99225 /src/internal | |
| parent | 3702cb5ab95575830488dc2b1ca9424651f828cf (diff) | |
| download | go-f4e7675d1150cb683f3d2db7a96084b0d6e26e83.tar.xz | |
all: clean unnecessary casts
Run 'unconvert -safe -apply' (https://github.com/mdempsky/unconvert)
Change-Id: I24b7cd7d286cddce86431d8470d15c5f3f0d1106
GitHub-Last-Rev: 022e75384c08bb899a8951ba0daffa0f2e14d5a7
GitHub-Pull-Request: golang/go#62662
Reviewed-on: https://go-review.googlesource.com/c/go/+/528696
Auto-Submit: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
Diffstat (limited to 'src/internal')
| -rw-r--r-- | src/internal/bisect/bisect.go | 2 | ||||
| -rw-r--r-- | src/internal/fuzz/mutator.go | 2 | ||||
| -rw-r--r-- | src/internal/syscall/windows/registry/value.go | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/src/internal/bisect/bisect.go b/src/internal/bisect/bisect.go index 26d3ebf333..bf67ceb9d7 100644 --- a/src/internal/bisect/bisect.go +++ b/src/internal/bisect/bisect.go @@ -728,7 +728,7 @@ func fnvString(h uint64, x string) uint64 { func fnvUint64(h uint64, x uint64) uint64 { for i := 0; i < 8; i++ { - h ^= uint64(x & 0xFF) + h ^= x & 0xFF x >>= 8 h *= prime64 } diff --git a/src/internal/fuzz/mutator.go b/src/internal/fuzz/mutator.go index 4310d57c5c..9bba0d627b 100644 --- a/src/internal/fuzz/mutator.go +++ b/src/internal/fuzz/mutator.go @@ -74,7 +74,7 @@ func (m *mutator) mutate(vals []any, maxBytes int) { case uint32: vals[i] = uint32(m.mutateUInt(uint64(v), math.MaxUint32)) case uint64: - vals[i] = m.mutateUInt(uint64(v), maxUint) + vals[i] = m.mutateUInt(v, maxUint) case float32: vals[i] = float32(m.mutateFloat(float64(v), math.MaxFloat32)) case float64: diff --git a/src/internal/syscall/windows/registry/value.go b/src/internal/syscall/windows/registry/value.go index bda16fda5d..67b1144eae 100644 --- a/src/internal/syscall/windows/registry/value.go +++ b/src/internal/syscall/windows/registry/value.go @@ -241,7 +241,7 @@ func (k Key) GetIntegerValue(name string) (val uint64, valtype uint32, err error if len(data) != 8 { return 0, typ, errors.New("QWORD value is not 8 bytes long") } - return uint64(*(*uint64)(unsafe.Pointer(&data[0]))), QWORD, nil + return *(*uint64)(unsafe.Pointer(&data[0])), QWORD, nil default: return 0, typ, ErrUnexpectedType } |
