Small improvement

This commit is contained in:
Emmanuel Marty
2022-04-04 13:58:00 +02:00
committed by GitHub
parent 34de880080
commit 81fd3af0b3

View File

@@ -229,12 +229,11 @@ static void lzsa_insert_forward_match_v2(lzsa_compressor *pCompressor, const uns
for (r = 0; fwd_match[r].length; r++) { for (r = 0; fwd_match[r].length; r++) {
if (fwd_match[r].offset == nMatchOffset) { if (fwd_match[r].offset == nMatchOffset) {
r = -1;
break; break;
} }
} }
if (r != -1) { if (fwd_match[r].length == 0) {
int nMaxRepLen = nEndOffset - nRepPos; int nMaxRepLen = nEndOffset - nRepPos;
if (nMaxRepLen > LCP_MAX) if (nMaxRepLen > LCP_MAX)
nMaxRepLen = LCP_MAX; nMaxRepLen = LCP_MAX;