Skip to content

Commit

Permalink
net: avoid unnecessary type conversions
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
namusyaka authored and bradfitz committed Mar 10, 2018
1 parent 5e52471 commit 8f406af
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/net/ip.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 8f406af

Please sign in to comment.