From: inikep Date: Thu, 10 Mar 2016 12:18:36 +0000 (+0100) Subject: small ratio improvement with MINMATCH=3 X-Git-Tag: v0.6.0^2~17^2~72^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b0c640d9343b8d04b93a137cca5640dedeecd295;p=thirdparty%2Fzstd.git small ratio improvement with MINMATCH=3 --- diff --git a/lib/zstd_opt.h b/lib/zstd_opt.h index f89b737a0..aa0b70237 100644 --- a/lib/zstd_opt.h +++ b/lib/zstd_opt.h @@ -244,8 +244,8 @@ static U32 ZSTD_insertBtAndGetAllMatches ( if (minMatch == 3) { /* HC3 match finder */ U32 matchIndex3 = ZSTD_insertAndFindFirstIndexHash3 (zc, ip); - - if (matchIndex3>windowLow) { + + if (matchIndex3>windowLow && (current - matchIndex3 < (1<<18))) { const BYTE* match; size_t currentMl=0; if ((!extDict) || matchIndex3 >= dictLimit) {