Go: internal/bytealg Index | Files

package bytealg

import "internal/bytealg"

Index

Package Files

bytealg.go compare_native.go count_native.go equal_native.go index_amd64.go index_native.go indexbyte_native.go

Constants

const MaxBruteForce = 64

Variables

var MaxLen int

MaxLen is the maximum length of the string to be searched for (argument b) in Index.

func Compare Uses

func Compare(a, b []byte) int

go:noescape

func Count Uses

func Count(b []byte, c byte) int

go:noescape

func CountString Uses

func CountString(s string, c byte) int

go:noescape

func Cutover Uses

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 Uses

func Equal(a, b []byte) bool

go:noescape

func Index Uses

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 Uses

func IndexByte(b []byte, c byte) int

go:noescape

func IndexByteString Uses

func IndexByteString(s string, c byte) int

go:noescape

func IndexString Uses

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.

Package bytealg imports 2 packages (graph) and is imported by 16 packages. Updated 2019-05-07. Refresh now. Tools for package owners.