]> Cypherpunks repositories - gostls13.git/commitdiff
net: avoid unnecessary type conversions
authorKunpei Sakai <namusyaka@gmail.com>
Sat, 10 Mar 2018 19:07:58 +0000 (04:07 +0900)
committerBrad Fitzpatrick <bradfitz@golang.org>
Sat, 10 Mar 2018 20:59:45 +0000 (20:59 +0000)
CL generated mechanically with github.com/mdempsky/unconvert.

Change-Id: I6c555da5972618dca4302ef8be8d93c765f95db3
Reviewed-on: https://go-review.googlesource.com/100035
Run-TryBot: Kunpei Sakai <namusyaka@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/net/ip.go

index a94ff7313009b0730db60c265392c5e199090f01..d5b405179448be30ab29503ea44c8f2a9d37a1bf 100644 (file)
@@ -265,17 +265,17 @@ func (ip IP) Mask(mask IPMask) IP {
 // that dst has sufficient length.
 func ubtoa(dst []byte, start int, v byte) int {
        if v < 10 {
-               dst[start] = byte(v + '0')
+               dst[start] = v + '0'
                return 1
        } else if v < 100 {
-               dst[start+1] = byte(v%10 + '0')
-               dst[start] = byte(v/10 + '0')
+               dst[start+1] = v%10 + '0'
+               dst[start] = v/10 + '0'
                return 2
        }
 
-       dst[start+2] = byte(v%10 + '0')
-       dst[start+1] = byte((v/10)%10 + '0')
-       dst[start] = byte(v/100 + '0')
+       dst[start+2] = v%10 + '0'
+       dst[start+1] = (v/10)%10 + '0'
+       dst[start] = v/100 + '0'
        return 3
 }