Add bounds check comment to dddToByte
This commit is contained in:
parent
30d0133e57
commit
34d23c00e1
4
msg.go
4
msg.go
|
@ -556,12 +556,12 @@ func unpackTxt(msg []byte, off0 int) (ss []string, off int, err error) {
|
|||
func isDigit(b byte) bool { return b >= '0' && b <= '9' }
|
||||
|
||||
func dddToByte(s []byte) byte {
|
||||
_ = s[2]
|
||||
_ = s[2] // bounds check hint to compiler; see golang.org/issue/14808
|
||||
return byte((s[0]-'0')*100 + (s[1]-'0')*10 + (s[2] - '0'))
|
||||
}
|
||||
|
||||
func dddStringToByte(s string) byte {
|
||||
_ = s[2]
|
||||
_ = s[2] // bounds check hint to compiler; see golang.org/issue/14808
|
||||
return byte((s[0]-'0')*100 + (s[1]-'0')*10 + (s[2] - '0'))
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue