mirror of
https://github.com/golang/go.git
synced 2025-05-12 11:04:11 +00:00
The function is here ONLY for symmetry with package bytes. This function should be used ONLY if it makes code clearer. It is not here for performance. Remove any performance benefit. If performance becomes an issue, the compiler should be fixed to recognize the three-way compare (for all comparable types) rather than encourage people to micro-optimize by using this function. Change-Id: I71f4130bce853f7aef724c6044d15def7987b457 Reviewed-on: https://go-review.googlesource.com/3012 Reviewed-by: Rob Pike <r@golang.org>
9 lines
339 B
Go
9 lines
339 B
Go
// Copyright 2013 The Go Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
package strings
|
|
|
|
// IndexByte returns the index of the first instance of c in s, or -1 if c is not present in s.
|
|
func IndexByte(s string, c byte) int // ../runtime/asm_$GOARCH.s
|