github.com/shogo82148/std@v1.22.1-0.20240327122250-4e474527810c/internal/bytealg/index_generic.go (about) 1 // Copyright 2018 The Go Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 //go:build !amd64 && !arm64 && !s390x && !ppc64le && !ppc64 6 7 package bytealg 8 9 const MaxBruteForce = 0 10 11 // Index returns the index of the first instance of b in a, or -1 if b is not present in a. 12 // Requires 2 <= len(b) <= MaxLen. 13 func Index(a, b []byte) int 14 15 // IndexString returns the index of the first instance of b in a, or -1 if b is not present in a. 16 // Requires 2 <= len(b) <= MaxLen. 17 func IndexString(a, b string) int 18 19 // Cutover reports the number of failures of IndexByte we should tolerate 20 // before switching over to Index. 21 // n is the number of bytes processed so far. 22 // See the bytes.Index implementation for details. 23 func Cutover(n int) int