bytes_decl.go 875 B

12345678910111213141516171819202122232425
  1. // Copyright 2010 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. package bytes
  5. //go:noescape
  6. // IndexByte returns the index of the first instance of c in s, or -1 if c is not present in s.
  7. func IndexByte(s []byte, c byte) int // ../runtime/asm_$GOARCH.s
  8. //go:noescape
  9. // Equal returns a boolean reporting whether a and b
  10. // are the same length and contain the same bytes.
  11. // A nil argument is equivalent to an empty slice.
  12. func Equal(a, b []byte) bool // ../runtime/asm_$GOARCH.s
  13. //go:noescape
  14. // Compare returns an integer comparing two byte slices lexicographically.
  15. // The result will be 0 if a==b, -1 if a < b, and +1 if a > b.
  16. // A nil argument is equivalent to an empty slice.
  17. func Compare(a, b []byte) int // ../runtime/noasm_arm.goc or ../runtime/asm_{386,amd64}.s