Skip to content

Commit

Permalink
Merge pull request #447 from Shopify/trivial-cleanup
Browse files Browse the repository at this point in the history
trivial: replace x=x+y with x+=y
  • Loading branch information
eapache committed May 8, 2015
2 parents 7b0d88f + ad91627 commit 23d5233
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions snappy.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ package sarama

import (
"bytes"
"code.google.com/p/snappy-go/snappy"
"encoding/binary"

"code.google.com/p/snappy-go/snappy"
)

var snappyMagic = []byte{130, 83, 78, 65, 80, 80, 89, 0}
Expand All @@ -25,13 +26,13 @@ func snappyDecode(src []byte) ([]byte, error) {
)
for pos < max {
size := binary.BigEndian.Uint32(src[pos : pos+4])
pos = pos + 4
pos += 4

chunk, err = snappy.Decode(chunk, src[pos:pos+size])
if err != nil {
return nil, err
}
pos = pos + size
pos += size
dst = append(dst, chunk...)
}
return dst, nil
Expand Down

0 comments on commit 23d5233

Please sign in to comment.