]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
Rename enableDedicatedDictSearch to dedicatedDictSearch in MatchState
authorW. Felix Handte <w@felixhandte.com>
Wed, 12 Aug 2020 20:50:44 +0000 (16:50 -0400)
committerW. Felix Handte <w@felixhandte.com>
Thu, 10 Sep 2020 22:51:52 +0000 (18:51 -0400)
This makes it clear that not only is the feature allowed here, we're actually
using it, as opposed to the CCtxParam field, in which it's enabled, but we may
or may not be using it.

lib/compress/zstd_compress.c
lib/compress/zstd_compress_internal.h

index 8fd10a688c21937f2039ea7818afae1b224203ff..c3d317d25900740cc8d0bd7e21221f8deced451d 100644 (file)
@@ -3403,7 +3403,7 @@ static size_t ZSTD_initCDict_internal(
     DEBUGLOG(3, "ZSTD_initCDict_internal (dictContentType:%u)", (unsigned)dictContentType);
     assert(!ZSTD_checkCParams(cParams));
     cdict->matchState.cParams = cParams;
-    cdict->matchState.enableDedicatedDictSearch = params.enableDedicatedDictSearch;
+    cdict->matchState.dedicatedDictSearch = params.enableDedicatedDictSearch;
     if ((dictLoadMethod == ZSTD_dlm_byRef) || (!dictBuffer) || (!dictSize)) {
         cdict->dictContent = dictBuffer;
     } else {
@@ -3512,9 +3512,9 @@ ZSTDLIB_API ZSTD_CDict* ZSTD_createCDict_advanced2(const void* dict, size_t dict
                                                   ZSTD_CCtx_params* cctxParams,
                                                   ZSTD_customMem customMem)
 {
-    int const enableDedicatedDictSearch = cctxParams->enableDedicatedDictSearch &&
+    int const dedicatedDictSearch = cctxParams->enableDedicatedDictSearch &&
         ZSTD_dedicatedDictSearch_isSupported(cctxParams->compressionLevel, dictSize);
-    if (!enableDedicatedDictSearch) {
+    if (!dedicatedDictSearch) {
         ZSTD_compressionParameters cParams = ZSTD_getCParams_internal(
             cctxParams->compressionLevel, ZSTD_CONTENTSIZE_UNKNOWN, dictSize);
         return ZSTD_createCDict_advanced(dict, dictSize,
index 8f4d2c55478d1fc6d563899a5cba2a462ffc6f0a..7b8272753d4d8a8f54d9afdf2caf3ed811c0078b 100644 (file)
@@ -153,7 +153,9 @@ struct ZSTD_matchState_t {
     U32* hashTable;
     U32* hashTable3;
     U32* chainTable;
-    int enableDedicatedDictSearch;
+    int dedicatedDictSearch;  /* Indicates whether this matchState is using the
+                               * dedicated dictionary search structure.
+                               */
     optState_t opt;         /* optimal parser state */
     const ZSTD_matchState_t* dictMatchState;
     ZSTD_compressionParameters cParams;
@@ -768,7 +770,7 @@ MEM_STATIC ZSTD_dictMode_e ZSTD_matchState_dictMode(const ZSTD_matchState_t *ms)
     return ZSTD_window_hasExtDict(ms->window) ?
         ZSTD_extDict :
         ms->dictMatchState != NULL ?
-            (ms->dictMatchState->enableDedicatedDictSearch ? ZSTD_dedicatedDictSearch : ZSTD_dictMatchState) :
+            (ms->dictMatchState->dedicatedDictSearch ? ZSTD_dedicatedDictSearch : ZSTD_dictMatchState) :
             ZSTD_noDict;
 }