From: Bimba Shrestha Date: Thu, 11 Jun 2020 21:19:12 +0000 (-0700) Subject: always attach dict when using dedicatedDictSearch X-Git-Tag: v1.4.7~81^2~44 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b7dddbe89b19d97e806552e3a79bff17aef3eb09;p=thirdparty%2Fzstd.git always attach dict when using dedicatedDictSearch --- diff --git a/lib/compress/zstd_compress.c b/lib/compress/zstd_compress.c index b7d7bcd02..3671a6621 100644 --- a/lib/compress/zstd_compress.c +++ b/lib/compress/zstd_compress.c @@ -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