]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
fixed dfast strategy
authorYann Collet <yann.collet.73@gmail.com>
Tue, 12 Jul 2016 11:03:48 +0000 (13:03 +0200)
committerYann Collet <yann.collet.73@gmail.com>
Tue, 12 Jul 2016 11:03:48 +0000 (13:03 +0200)
lib/compress/zstd_compress.c

index 133899ef9bbe9a488223be50e706b2fec1f1b4bb..70f17b537d2b56c63a6a6cfb8042541f9cb0e323 100644 (file)
@@ -1544,7 +1544,7 @@ static void ZSTD_compressBlock_doubleFast_extDict_generic(ZSTD_CCtx* ctx,
                 offset_2 = offset_1;
                 offset_1 = offset;
                 ZSTD_storeSeq(seqStorePtr, ip-anchor, anchor, offset + ZSTD_REP_MOVE, mLength-MINMATCH);
-            } else if ((matchIndex > lowestIndex) && (MEM_read32(match) != MEM_read32(ip))) {
+            } else if ((matchIndex > lowestIndex) && (MEM_read32(match) == MEM_read32(ip))) {
                 const BYTE* matchEnd = matchIndex < dictLimit ? dictEnd : iend;
                 const BYTE* lowMatchPtr = matchIndex < dictLimit ? dictStart : lowPrefixPtr;
                 U32 offset;
@@ -2410,7 +2410,7 @@ static size_t ZSTD_compress_generic (ZSTD_CCtx* cctx,
     BYTE* op = ostart;
     const U32 maxDist = 1 << cctx->params.cParams.windowLog;
     ZSTD_stats_t* stats = &cctx->seqStore.stats;
-    ZSTD_statsInit(stats);
+    ZSTD_statsInit(stats);   /* debug only */
 
     if (cctx->params.fParams.checksumFlag)
         XXH64_update(&cctx->xxhState, src, srcSize);