]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
Switch to Original Match Calc for noDict Repcode Check
authorW. Felix Handte <w@felixhandte.com>
Wed, 9 May 2018 22:40:23 +0000 (18:40 -0400)
committerW. Felix Handte <w@felixhandte.com>
Wed, 23 May 2018 21:53:03 +0000 (17:53 -0400)
lib/compress/zstd_fast.c

index f211f1425a3b3144a1378e55dcf0b7ef89f45ebc..48a165d3fbb1752871229666f8706f402f0e4651 100644 (file)
@@ -112,7 +112,7 @@ size_t ZSTD_compressBlock_fast_generic(
             ip++;
             ZSTD_storeSeq(seqStore, ip-anchor, anchor, 0, mLength-MINMATCH);
         } else if ( dictMode == ZSTD_noDict
-                 && (offset_1 > 0) & (MEM_read32(repMatch) == MEM_read32(ip+1))) {
+                 && (offset_1 > 0) & (MEM_read32(ip+1-offset_1) == MEM_read32(ip+1))) {
             mLength = ZSTD_count(ip+1+4, ip+1+4-offset_1, iend) + 4;
             ip++;
             ZSTD_storeSeq(seqStore, ip-anchor, anchor, 0, mLength-MINMATCH);