From: W. Felix Handte Date: Wed, 20 Jun 2018 19:51:14 +0000 (-0400) Subject: Also Use `matchLow` for HC3 Match X-Git-Tag: v1.3.5~3^2~10^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9c14eafe3d679472382253b6de4ac5e40baac69e;p=thirdparty%2Fzstd.git Also Use `matchLow` for HC3 Match --- diff --git a/lib/compress/zstd_opt.c b/lib/compress/zstd_opt.c index 0abdf3b90..90a262025 100644 --- a/lib/compress/zstd_opt.c +++ b/lib/compress/zstd_opt.c @@ -581,7 +581,7 @@ U32 ZSTD_insertBtAndGetAllMatches ( /* HC3 match finder */ if ((mls == 3) /*static*/ && (bestLength < mls)) { U32 const matchIndex3 = ZSTD_insertAndFindFirstIndexHash3(ms, ip); - if ((matchIndex3 > windowLow) + if ((matchIndex3 >= matchLow) & (current - matchIndex3 < (1<<18)) /*heuristic : longer distance likely too expensive*/ ) { size_t mlen; if ((dictMode == ZSTD_noDict) /*static*/ || (dictMode == ZSTD_dictMatchState) /*static*/ || (matchIndex3 >= dictLimit)) {