Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -447,12 +447,17 @@ private void resetZeroSequence(int offset, int word, boolean fromBeginning)

private void resetLiteral(int offset, int word, boolean fromBeginning)
{
len = 0;
for (int i = 0; i < MAX_LITERAL_LENGTH; i++) {
if ((word & (1 << i)) != 0) {
buffer[len++] = offset + i;
}
int len = 0;
word &= ALL_ONES_WITHOUT_MSB;
int[] buffer = this.buffer;
while (word != 0) {
int trailingZeros = Integer.numberOfTrailingZeros(word);
offset += trailingZeros;
buffer[len++] = offset;
word >>= trailingZeros;
word--; // clear the lowest bit
}
this.len = len;
current = fromBeginning ? 0 : len;
}

Expand Down