Skip to content

Commit

Permalink
Another tiny speedup
Browse files Browse the repository at this point in the history
  • Loading branch information
emmanuel-marty authored Sep 8, 2021
1 parent ce19978 commit fa23433
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/shrink.c
Original file line number Diff line number Diff line change
Expand Up @@ -550,9 +550,10 @@ static void apultra_optimize_forward(apultra_compressor *pCompressor, const unsi
}

for (j = 0; j < nNumArrivalsForThisPos; j++) {
if (nMatchOffset != cur_arrival[j].rep_offset || cur_arrival[j].follows_literal == 0) {
const int nFollowsLiteral = cur_arrival[j].follows_literal;
if (nMatchOffset != cur_arrival[j].rep_offset || nFollowsLiteral == 0) {
int nPrevCost = cur_arrival[j].cost & 0x3fffffff;
int nMatchCmdCost = nNoRepMatchMatchLenCost + nNoRepMatchOffsetCostForLit[cur_arrival[j].follows_literal];
int nMatchCmdCost = nNoRepMatchMatchLenCost + nNoRepMatchOffsetCostForLit[nFollowsLiteral];
int nCodingChoiceCost = nPrevCost + nMatchCmdCost;

if (nCodingChoiceCost <= (pDestSlots[nArrivalsPerPosition - 1].cost + 1)) {
Expand Down

0 comments on commit fa23433

Please sign in to comment.