const MaxBruteForce = 64
const MaxBruteForce = 16
Empirical data shows that using Index can get better performance when len(s) <= 16.
const MaxBruteForce = 64
var MaxLen int
MaxLen is the maximum length of the string to be searched for (argument b) in Index.
func Compare(a, b []byte) int
go:noescape
func Count(b []byte, c byte) int
go:noescape
func CountString(s string, c byte) int
go:noescape
func Cutover(n int) int
Cutover reports the number of failures of IndexByte we should tolerate before switching over to Index. n is the number of bytes processed so far. See the bytes.Index implementation for details.
func Equal(a, b []byte) bool
Equal reports whether a and b are the same length and contain the same bytes. A nil argument is equivalent to an empty slice.
Equal is equivalent to bytes.Equal. It is provided here for convenience, because some packages cannot depend on bytes.
func Index(a, b []byte) int
Index returns the index of the first instance of b in a, or -1 if b is not present in a. Requires 2 <= len(b) <= MaxLen.
func IndexByte(b []byte, c byte) int
go:noescape
func IndexByteString(s string, c byte) int
go:noescape
func IndexString(a, b string) int
IndexString returns the index of the first instance of b in a, or -1 if b is not present in a. Requires 2 <= len(b) <= MaxLen.