Skip to content

Commit 6f1cb87

Browse files
authored
Merge pull request #4443 from facebook/opt_simplify_4442
simplify sequence resolution in zstd_opt
2 parents f9e26bb + 0055ce7 commit 6f1cb87

1 file changed

Lines changed: 2 additions & 10 deletions

File tree

lib/compress/zstd_opt.c

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1382,16 +1382,8 @@ ZSTD_compressBlock_opt_generic(ZSTD_MatchState_t* ms,
13821382
assert(storeEnd < ZSTD_OPT_SIZE);
13831383
DEBUGLOG(6, "last stretch copied into pos=%u (llen=%u,mlen=%u,ofc=%u)",
13841384
storeEnd, lastStretch.litlen, lastStretch.mlen, lastStretch.off);
1385-
if (lastStretch.litlen > 0) {
1386-
/* last "sequence" is unfinished: just a bunch of literals */
1387-
opt[storeEnd].litlen = lastStretch.litlen;
1388-
opt[storeEnd].mlen = 0;
1389-
storeStart = storeEnd-1;
1390-
opt[storeStart] = lastStretch;
1391-
} {
1392-
opt[storeEnd] = lastStretch; /* note: litlen will be fixed */
1393-
storeStart = storeEnd;
1394-
}
1385+
opt[storeEnd] = lastStretch; /* note: litlen will be fixed */
1386+
storeStart = storeEnd;
13951387
while (1) {
13961388
ZSTD_optimal_t nextStretch = opt[stretchPos];
13971389
opt[storeStart].litlen = nextStretch.litlen;

0 commit comments

Comments
 (0)