Skip to content

Commit eb9c2c2

Browse files
bgoulddeadprogram
authored andcommitted
Added indexBytePortal from standard library to link as implementation for internal/bytealg.IndexByte
1 parent 519adf3 commit eb9c2c2

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/runtime/bytes.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package runtime
2+
3+
//go:linkname indexBytePortable internal/bytealg.IndexByte
4+
func indexBytePortable(s []byte, c byte) int {
5+
for i, b := range s {
6+
if b == c {
7+
return i
8+
}
9+
}
10+
return -1
11+
}

0 commit comments

Comments
 (0)