Skip to content

Commit 50fabab

Browse files
committed
Adjust comment as per CR
Change-Id: I1fa2dbc38b49b263788e666339a748761fe294f4
1 parent 56c7485 commit 50fabab

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/compress/flate/deflatefast.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,10 @@ func (e *deflateFast) shiftOffsets() {
297297
for i := range e.table[:] {
298298
v := e.table[i].offset - e.cur + maxMatchOffset + 1
299299
if v < 0 {
300-
// Indicate that this table entry is invalid.
300+
// We want to reset e.cur to maxMatchOffset + 1, so we need to shift
301+
// all table entries down by (e.cur - (maxMatchOffset + 1)).
302+
// Because we ignore matches > maxMatchOffset, we can cap
303+
// any negative offsets at 0.
301304
v = 0
302305
}
303306
e.table[i].offset = v

0 commit comments

Comments
 (0)