github.com/SandwichDev/go-internals@v0.0.0-20210605002614-12311ac6b2c5/bytealg/index_native.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  // +build amd64 arm64 s390x
     6  
     7  package bytealg
     8  
     9  //go:noescape
    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  //go:noescape
    16  
    17  // IndexString returns the index of the first instance of b in a, or -1 if b is not present in a.
    18  // Requires 2 <= len(b) <= MaxLen.
    19  func IndexString(a, b string) int