diff options
author | ferhat elmas <elmas.ferhat@gmail.com> | 2017-11-29 02:24:31 +0100 |
---|---|---|
committer | ferhat elmas <elmas.ferhat@gmail.com> | 2017-11-29 13:01:32 +0100 |
commit | 18e6f9daa3899318d36b525b068837f49bc2c1cf (patch) | |
tree | a797b79d0a750972ba9809eb52691cb09f9b6383 /plumbing/protocol/packp/ulreq_encode.go | |
parent | c07c778ed043429427533e2fd7549a3d54b903f1 (diff) | |
download | go-git-18e6f9daa3899318d36b525b068837f49bc2c1cf.tar.gz |
all: simplification
- no length for map initialization
- don't check for boolean/error return
- don't format string
- use string method of bytes buffer instead of converting bytes to
string
- use `strings.Contains` instead of `strings.Index`
- use `bytes.Equal` instead of `bytes.Compare`
Diffstat (limited to 'plumbing/protocol/packp/ulreq_encode.go')
-rw-r--r-- | plumbing/protocol/packp/ulreq_encode.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/plumbing/protocol/packp/ulreq_encode.go b/plumbing/protocol/packp/ulreq_encode.go index 4a26e74..89a5986 100644 --- a/plumbing/protocol/packp/ulreq_encode.go +++ b/plumbing/protocol/packp/ulreq_encode.go @@ -70,7 +70,7 @@ func (e *ulReqEncoder) encodeFirstWant() stateFn { func (e *ulReqEncoder) encodeAditionalWants() stateFn { last := e.data.Wants[0] for _, w := range e.data.Wants[1:] { - if bytes.Compare(last[:], w[:]) == 0 { + if bytes.Equal(last[:], w[:]) { continue } @@ -90,7 +90,7 @@ func (e *ulReqEncoder) encodeShallows() stateFn { var last plumbing.Hash for _, s := range e.data.Shallows { - if bytes.Compare(last[:], s[:]) == 0 { + if bytes.Equal(last[:], s[:]) { continue } |