]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
loading dict using new algorithm
authorBimba Shrestha <bimbashrestha@fb.com>
Fri, 12 Jun 2020 02:41:03 +0000 (19:41 -0700)
committerW. Felix Handte <w@felixhandte.com>
Thu, 10 Sep 2020 22:51:52 +0000 (18:51 -0400)
lib/compress/zstd_compress.c
lib/compress/zstd_lazy.c

index 31c49a9c3c645edb637c99ee3f55a9b1d06e8dce..4ad60400f2ac895e90a3bce22c0e8182f05fac61 100644 (file)
@@ -2892,7 +2892,9 @@ static size_t ZSTD_loadDictionaryContent(ZSTD_matchState_t* ms,
         case ZSTD_greedy:
         case ZSTD_lazy:
         case ZSTD_lazy2:
-            if (chunk >= HASH_READ_SIZE)
+            if (chunk >= HASH_READ_SIZE && params->enableDedicatedDictSearch)
+                ZSTD_lazy_loadDictionary(ms, ichunk-HASH_READ_SIZE);
+            else if (chunk >= HASH_READ_SIZE)
                 ZSTD_insertAndFindFirstIndex(ms, ichunk-HASH_READ_SIZE);
             break;
 
index f58e6a27bd2a292a5344e7bb1440ee005685149c..e717ef74e0f5fda3c34b7dcc9b63d30e9b5ce9bd 100644 (file)
@@ -580,7 +580,7 @@ size_t ZSTD_HcFindBestMatch_generic (
             /* save best solution */
             if (currentMl > ml) {
                 ml = currentMl;
-                *offsetPtr = current - (matchIndex + dmsIndexDelta) + ZSTD_REP_MOVE;
+                *offsetPtr = curr - (matchIndex + dmsIndexDelta) + ZSTD_REP_MOVE;
                 if (ip+currentMl == iLimit) break; /* best possible, avoids read overflow on next attempt */
             }