1
0
mirror of https://github.com/golang/go synced 2024-11-15 04:50:31 -07:00

reflect: remove unnecessary type conversions of untyped PtrSize

Change-Id: I0f20020c2929b58958ce228b9f175d5b4fd77a1a
Reviewed-on: https://go-review.googlesource.com/c/go/+/578855
Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Russ Cox <rsc@golang.org>
Commit-Queue: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
Ian Lance Taylor 2024-04-14 11:06:46 -07:00 committed by Gopher Robot
parent 35c619398b
commit 903e0ffbed

View File

@ -2936,14 +2936,14 @@ func addTypeBits(bv *bitVector, offset uintptr, t *abi.Type) {
switch Kind(t.Kind_ & abi.KindMask) { switch Kind(t.Kind_ & abi.KindMask) {
case Chan, Func, Map, Pointer, Slice, String, UnsafePointer: case Chan, Func, Map, Pointer, Slice, String, UnsafePointer:
// 1 pointer at start of representation // 1 pointer at start of representation
for bv.n < uint32(offset/uintptr(goarch.PtrSize)) { for bv.n < uint32(offset/goarch.PtrSize) {
bv.append(0) bv.append(0)
} }
bv.append(1) bv.append(1)
case Interface: case Interface:
// 2 pointers // 2 pointers
for bv.n < uint32(offset/uintptr(goarch.PtrSize)) { for bv.n < uint32(offset/goarch.PtrSize) {
bv.append(0) bv.append(0)
} }
bv.append(1) bv.append(1)