Browse Source

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

pull/774/head
BCG 5 years ago
committed by Ron Evans
parent
commit
eb9c2c276e
  1. 11
      src/runtime/bytes.go

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
}
Loading…
Cancel
Save