]> Cypherpunks repositories - gostls13.git/commit
bytes: minor optimization to lastIndexFunc
authorBrad Fitzpatrick <bradfitz@golang.org>
Fri, 8 Feb 2013 00:00:06 +0000 (16:00 -0800)
committerBrad Fitzpatrick <bradfitz@golang.org>
Fri, 8 Feb 2013 00:00:06 +0000 (16:00 -0800)
commit30a9957aacb21fef5195a43dba99669465a789e7
tree87acc5cdf127b2977402111ec22a9b8b9ff296e2
parent7594440ef134ddebc2864d207815eb325adda13f
bytes: minor optimization to lastIndexFunc

Before and after:
BenchmarkTrimSpace  20000000   81.3 ns/op
BenchmarkTrimSpace  50000000   58.0 ns/op

(most whitespace trimming is ASCII whitespace)

Same optimization appeared a handful of other places
in this file, but not here.

R=golang-dev, dave
CC=golang-dev
https://golang.org/cl/7305063
src/pkg/bytes/bytes.go
src/pkg/bytes/bytes_test.go