]> Cypherpunks repositories - gostls13.git/commit
all: prefer bytes.IndexByte over bytes.Index
authorMarvin Stenger <marvin.stenger94@gmail.com>
Thu, 21 Sep 2017 17:23:51 +0000 (19:23 +0200)
committerIan Lance Taylor <iant@golang.org>
Wed, 27 Sep 2017 01:09:13 +0000 (01:09 +0000)
commit5e42658fc04c8f4ce15f3e2d75f4f5d045640738
tree605b780803869f61926d380b586ca0f010b3f0ee
parentd2826d3e068f096f4b5371175afb7e5d8c4aa73c
all: prefer bytes.IndexByte over bytes.Index

bytes.IndexByte can be used wherever the second argument to
strings.Index is exactly one byte long, so we do that with this change.

This avoids generating unnecessary string symbols/converison and saves
a few calls to bytes.Index.

Change-Id: If31c775790e01edfece1169e398ad6a754fb4428
Reviewed-on: https://go-review.googlesource.com/66373
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/cmd/link/internal/ld/lib.go
src/crypto/tls/handshake_client_test.go
src/encoding/json/decode_test.go
src/encoding/pem/pem.go