]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
Remove blockCompressor NULL Checks
authorW. Felix Handte <w@felixhandte.com>
Mon, 24 Apr 2023 18:50:54 +0000 (14:50 -0400)
committerW. Felix Handte <w@felixhandte.com>
Thu, 4 May 2023 16:18:58 +0000 (12:18 -0400)
lib/compress/zstd_compress.c
lib/compress/zstd_ldm.c

index 09f0482394b600ea066014e8c39f8ee9f4ebf92e..521e5e5d681974958663fe5502d41edfa98d847b 100644 (file)
@@ -3344,7 +3344,6 @@ static size_t ZSTD_buildSeqStore(ZSTD_CCtx* zc, const void* src, size_t srcSize)
                         "External sequence producer returned error code %lu. Falling back to internal parser.",
                         (unsigned long)nbExternalSeqs
                     );
-                    RETURN_ERROR_IF(blockCompressor == NULL, parameter_combination_unsupported, "Got NULL block compressor!");
                     lastLLSize = blockCompressor(ms, &zc->seqStore, zc->blockState.nextCBlock->rep, src, srcSize);
             }   }
         } else {   /* not long range mode and no external matchfinder */
@@ -3353,7 +3352,6 @@ static size_t ZSTD_buildSeqStore(ZSTD_CCtx* zc, const void* src, size_t srcSize)
                     zc->appliedParams.useRowMatchFinder,
                     dictMode);
             ms->ldmSeqStore = NULL;
-            RETURN_ERROR_IF(blockCompressor == NULL, parameter_combination_unsupported, "Got NULL block compressor!");
             lastLLSize = blockCompressor(ms, &zc->seqStore, zc->blockState.nextCBlock->rep, src, srcSize);
         }
         {   const BYTE* const lastLiterals = (const BYTE*)src + srcSize - lastLLSize;
index eda45816e9938416019d5456eb20abe78d02cfe9..01c1f75aae4847a4880397e740ae514a9d168ce5 100644 (file)
@@ -676,8 +676,6 @@ size_t ZSTD_ldm_blockCompress(rawSeqStore_t* rawSeqStore,
     /* Input positions */
     BYTE const* ip = istart;
 
-    RETURN_ERROR_IF(blockCompressor == NULL, parameter_combination_unsupported, "Got NULL block compressor!");
-
     DEBUGLOG(5, "ZSTD_ldm_blockCompress: srcSize=%zu", srcSize);
     /* If using opt parser, use LDMs only as candidates rather than always accepting them */
     if (cParams->strategy >= ZSTD_btopt) {