Skip to content

Commit 0a36433

Browse files
smasher164bradfitz
authored andcommitted
strconv: remove redundant conversions to int
IntSize is an untyped constant that does not need explicit conversion. Annotating IntSize as an int and running github.com/mdempsky/unconvert reveals these two cases. Fixes #38682. Change-Id: I014646b7457ddcde32474810153229dcf0c269c6 Reviewed-on: https://go-review.googlesource.com/c/go/+/230306 Run-TryBot: Akhil Indurti <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Brad Fitzpatrick <[email protected]>
1 parent 287d1ec commit 0a36433

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/strconv/atoi.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ func ParseUint(s string, base int, bitSize int) (uint64, error) {
9696
}
9797

9898
if bitSize == 0 {
99-
bitSize = int(IntSize)
99+
bitSize = IntSize
100100
} else if bitSize < 0 || bitSize > 64 {
101101
return 0, bitSizeError(fnParseUint, s0, bitSize)
102102
}
@@ -203,7 +203,7 @@ func ParseInt(s string, base int, bitSize int) (i int64, err error) {
203203
}
204204

205205
if bitSize == 0 {
206-
bitSize = int(IntSize)
206+
bitSize = IntSize
207207
}
208208

209209
cutoff := uint64(1 << uint(bitSize-1))

0 commit comments

Comments
 (0)