]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
small ratio improvement with MINMATCH=3
authorinikep <inikep@gmail.com>
Thu, 10 Mar 2016 12:18:36 +0000 (13:18 +0100)
committerinikep <inikep@gmail.com>
Thu, 10 Mar 2016 12:18:36 +0000 (13:18 +0100)
lib/zstd_opt.h

index f89b737a085153a77645fd4bb03cb9e8c9adbac3..aa0b70237cb8d0b105e656a7e111e89f1fa3612d 100644 (file)
@@ -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) {