]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
Modify codepath to use opt parser exclusively if the compression level is high enough
authorsenhuang42 <senhuang96@fb.com>
Sat, 26 Sep 2020 15:13:39 +0000 (11:13 -0400)
committersenhuang42 <senhuang96@fb.com>
Wed, 7 Oct 2020 17:56:24 +0000 (13:56 -0400)
lib/compress/zstd_ldm.c

index dbfce3dce7fc1d048ebc192038d0dff0907b0ebe..c68693bd6f44e1817798ce3c7ebe796da3f21243 100644 (file)
@@ -576,6 +576,13 @@ size_t ZSTD_ldm_blockCompress(rawSeqStore_t* rawSeqStore,
     /* Input positions */
     BYTE const* ip = istart;
 
+    if (cParams->strategy >= ZSTD_btopt) {
+        size_t lastLLSize;
+        ms->ldmSeqStore = *rawSeqStore; /* copy current seqStore */
+        lastLLSize = blockCompressor(ms, seqStore, rep, src, srcSize);
+        return lastLLSize;
+    }
+
     DEBUGLOG(5, "ZSTD_ldm_blockCompress: srcSize=%zu", srcSize);
     assert(rawSeqStore->pos <= rawSeqStore->size);
     assert(rawSeqStore->size <= rawSeqStore->capacity);