]> Cypherpunks repositories - gostls13.git/commit
add bytes.IndexByte; common case we can make fast later.
authorRob Pike <r@golang.org>
Thu, 19 Nov 2009 03:23:08 +0000 (19:23 -0800)
committerRob Pike <r@golang.org>
Thu, 19 Nov 2009 03:23:08 +0000 (19:23 -0800)
commit8c1a627e5cf1621cf44387b13d9a0631e44236ae
tree198fa6a2f7c90a5489a169be3d9cc0b5870b9d04
parent1a8ebcc4b8502460d61fafb09d89a8275f98e547
add bytes.IndexByte; common case we can make fast later.
also pick off the special case in strings.Index.   don't want strings.IndexByte
because the call site will very rarely need to allocate and we can handle the
test in the code itself.   bytes.IndexByte can avoid a common allocation.

R=rsc
CC=golang-dev
https://golang.org/cl/156091
src/pkg/bytes/bytes.go
src/pkg/bytes/bytes_test.go
src/pkg/strings/strings.go
src/pkg/strings/strings_test.go