Skip to content

Commit

Permalink
Minor change to sync with other implementations
Browse files Browse the repository at this point in the history
  • Loading branch information
flanglet committed Oct 28, 2023
1 parent 74f8272 commit 9c61243
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion v2/transform/ROLZCodec.go
Original file line number Diff line number Diff line change
Expand Up @@ -999,6 +999,7 @@ func (this *rolzCodec2) findMatch(buf []byte, pos int, key uint32) (int, int) {
}
}

maxMatch -= 4
m := this.matches[key<<this.logPosChecks : (key+1)<<this.logPosChecks]
hash32 := rolzhash(buf[pos : pos+4])
counter := this.counters[key]
Expand All @@ -1024,7 +1025,7 @@ func (this *rolzCodec2) findMatch(buf []byte, pos int, key uint32) (int, int) {

n := 0

for n < maxMatch-4 {
for n < maxMatch {
if diff := binary.LittleEndian.Uint32(refBuf[n:]) ^ binary.LittleEndian.Uint32(curBuf[n:]); diff != 0 {
n += (bits.TrailingZeros32(diff) >> 3)
break
Expand Down

0 comments on commit 9c61243

Please sign in to comment.