From: smasher164 Date: Mon, 27 Apr 2020 17:23:24 +0000 (-0400) Subject: strconv: remove redundant conversions to int X-Git-Tag: go1.15beta1~338 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=0a364330a2abba1fede96c7cdd6432f3007866b3;p=gostls13.git 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 TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick --- diff --git a/src/strconv/atoi.go b/src/strconv/atoi.go index a4a8a37fb4..0b82fb0908 100644 --- a/src/strconv/atoi.go +++ b/src/strconv/atoi.go @@ -96,7 +96,7 @@ func ParseUint(s string, base int, bitSize int) (uint64, error) { } if bitSize == 0 { - bitSize = int(IntSize) + bitSize = IntSize } else if bitSize < 0 || bitSize > 64 { return 0, bitSizeError(fnParseUint, s0, bitSize) } @@ -203,7 +203,7 @@ func ParseInt(s string, base int, bitSize int) (i int64, err error) { } if bitSize == 0 { - bitSize = int(IntSize) + bitSize = IntSize } cutoff := uint64(1 << uint(bitSize-1))