Skip to content

Commit

Permalink
Minor performance improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
NeRdTheNed committed Nov 11, 2023
1 parent af43297 commit c487330
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -385,12 +385,12 @@ public void removeDistLitLeastExpensive(int mode) {
if (check.dist != 0L) {
assert check.decodedVal != null;
final int litlen = Constants.len2litlen((int) check.litlen, check.edgecase) - Constants.LITLEN_TBL_OFFSET;
litSeen[litlen] = true;

if (litNoAllow[litlen]) {
continue;
}

litSeen[litlen] = true;
final int checkSize = getLitLenSize(check, litlenDec, distDec);
int totalSize = 0;

Expand Down Expand Up @@ -494,7 +494,6 @@ public void rewriteHeader(boolean ohh, boolean use8, boolean use7, boolean alt8,
dynamicHeaderSizeBits = 0L;
numLitlenLens = litlenDec.table.codeLen.length;
numDistLens = distDec.table.codeLen.length;
rlePairs = new ArrayList<>();
didCopyRLEPairs = true;
final List<Integer> repack = HuffmanTable.packCodeLengths(litlenDec.table.codeLen, distDec.table.codeLen, ohh, use8, use7, alt8, noRep, noZRep, noZRep2, noRepZeros);
codeLenDec = Huffman.ofRLEPacked(repack);
Expand All @@ -508,6 +507,7 @@ public void rewriteHeader(boolean ohh, boolean use8, boolean use7, boolean alt8,
final Iterator<Integer> iter = repack.iterator();
LitLen prePair = null;
final int combinedLens = numLitlenLens + numDistLens;
rlePairs = new ArrayList<>(combinedLens);

while (i < combinedLens) {
final int sym = iter.next();
Expand Down

0 comments on commit c487330

Please sign in to comment.