Added indexBytePortal from standard library to link as implementation for internal/bytealg.IndexByte

Этот коммит содержится в:
BCG 2020-01-23 00:06:34 -05:00 коммит произвёл Ron Evans
родитель 519adf3aef
коммит eb9c2c276e

11
src/runtime/bytes.go Обычный файл
Просмотреть файл

@ -0,0 +1,11 @@
package runtime
//go:linkname indexBytePortable internal/bytealg.IndexByte
func indexBytePortable(s []byte, c byte) int {
for i, b := range s {
if b == c {
return i
}
}
return -1
}