]> Cypherpunks repositories - gostls13.git/commit
src: Use bytes.Equal instead of bytes.Compare where possible.
authorMatthew Dempsky <mdempsky@google.com>
Sun, 6 Jan 2013 23:03:49 +0000 (10:03 +1100)
committerAndrew Gerrand <adg@golang.org>
Sun, 6 Jan 2013 23:03:49 +0000 (10:03 +1100)
commit46811d27ce6b3753f70bc49423f4f448e613609d
tree359271b9278036fbf6611d282d852e6980b23231
parent56961274bbbdac59ab23af9ad592dfac89c94869
src: Use bytes.Equal instead of bytes.Compare where possible.

bytes.Equal is simpler to read and should also be faster because
of short-circuiting and assembly implementations.

Change generated automatically using:
  gofmt -r 'bytes.Compare(a, b) == 0 -> bytes.Equal(a, b)'
  gofmt -r 'bytes.Compare(a, b) != 0 -> !bytes.Equal(a, b)'

R=golang-dev, dave, adg, rsc
CC=golang-dev
https://golang.org/cl/7038051
14 files changed:
src/cmd/gofmt/gofmt_test.go
src/cmd/gofmt/long_test.go
src/pkg/bufio/bufio_test.go
src/pkg/crypto/rsa/pkcs1v15_test.go
src/pkg/crypto/rsa/rsa_test.go
src/pkg/encoding/asn1/asn1_test.go
src/pkg/encoding/asn1/marshal_test.go
src/pkg/encoding/hex/hex_test.go
src/pkg/encoding/json/decode_test.go
src/pkg/encoding/json/scanner_test.go
src/pkg/exp/locale/collate/collate_test.go
src/pkg/exp/locale/collate/maketables.go
src/pkg/go/doc/doc_test.go
src/pkg/math/big/int_test.go