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)'
On Fri, Jan 4, 2013 at 10:00 AM, Dave Cheney <dave@cheney.net> wrote: > Can you ...
11 years, 8 months ago
(2013-01-03 23:03:42 UTC)
#3
On Fri, Jan 4, 2013 at 10:00 AM, Dave Cheney <dave@cheney.net> wrote:
> Can you please update the description with benchmarks for the packages
affected.
Oh, it looks like the only affected code was locale/maketables,
everything else is test code. Please ignore my request for benchmark
data, there won't be any.
Maybe this is a cause that go vet should watch for (similar to b :=
b[0:len(b)])
Please make the CL description begin with this line: src: use bytes.Equal instead of bytes.Compare ...
11 years, 8 months ago
(2013-01-06 21:37:07 UTC)
#4
Please make the CL description begin with this line:
src: use bytes.Equal instead of bytes.Compare where possible
(The src: prefix is important)
I will add you to the CONTRIBUTORS file.
*** Submitted as https://code.google.com/p/go/source/detail?r=ae4e014e0b77 *** src: Use bytes.Equal instead of bytes.Compare where possible. bytes.Equal is ...
11 years, 8 months ago
(2013-01-06 23:04:00 UTC)
#8
*** Submitted as https://code.google.com/p/go/source/detail?r=ae4e014e0b77 ***
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://codereview.appspot.com/7038051
Committer: Andrew Gerrand <adg@golang.org>
Issue 7038051: code review 7038051: src: Use bytes.Equal instead of bytes.Compare where pos...
(Closed)
Created 11 years, 8 months ago by mdempsky
Modified 11 years, 8 months ago
Reviewers:
Base URL:
Comments: 0