mirror of
https://github.com/golang/go
synced 2024-11-15 00:30:31 -07:00
a3bb28e5ff
Updates #14768 Change-Id: I33831f616eae5eeb099033e2b9cf90fa70d6ca86 Reviewed-on: https://go-review.googlesource.com/c/go/+/356869 Run-TryBot: Alberto Donizetti <alb.donizetti@gmail.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Dan Scales <danscales@google.com> Trust: Dan Scales <danscales@google.com> Trust: Alberto Donizetti <alb.donizetti@gmail.com>
11 lines
174 B
Go
11 lines
174 B
Go
package x
|
|
|
|
func indexByte(xs []byte, b byte) int { // ERROR "xs does not escape" "can inline indexByte"
|
|
for i, x := range xs {
|
|
if x == b {
|
|
return i
|
|
}
|
|
}
|
|
return -1
|
|
}
|