always attach dict when using dedicatedDictSearch

This commit is contained in:
Bimba Shrestha
2020-09-10 18:51:52 -04:00
committed by W. Felix Handte
parent e36a373df4
commit b7dddbe89b
+5 -1
View File
@@ -1640,7 +1640,11 @@ static int ZSTD_shouldAttachDict(const ZSTD_CDict* cdict,
U64 pledgedSrcSize)
{
size_t cutoff = attachDictSizeCutoffs[cdict->matchState.cParams.strategy];
return ( pledgedSrcSize <= cutoff
int const useDedicatedDictSearch =
params->enableDedicatedDictSearch &&
ZSTD_dedicatedDictSearch_isSupported(params->compressionLevel, cdict->dictContentSize);
return ( useDedicatedDictSearch
|| pledgedSrcSize <= cutoff
|| pledgedSrcSize == ZSTD_CONTENTSIZE_UNKNOWN
|| params->attachDictPref == ZSTD_dictForceAttach )
&& params->attachDictPref != ZSTD_dictForceCopy