Commit 8f406af8 authored by Kunpei Sakai's avatar Kunpei Sakai Committed by Brad Fitzpatrick

net: avoid unnecessary type conversions

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: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
parent 5e524717
......@@ -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
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment