From: W. Felix Handte Date: Mon, 27 Aug 2018 20:21:01 +0000 (-0700) Subject: For Supported Strategies, Attach Dict Even When Params Don't Match X-Git-Tag: v1.3.6^2~10^2~16 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eae8232f50bc7c73bef5fa6074e0781264989bbc;p=thirdparty%2Fzstd.git For Supported Strategies, Attach Dict Even When Params Don't Match --- diff --git a/lib/compress/zstd_compress.c b/lib/compress/zstd_compress.c index 174f1791d..ff49b0c5e 100644 --- a/lib/compress/zstd_compress.c +++ b/lib/compress/zstd_compress.c @@ -1330,8 +1330,10 @@ static int ZSTD_shouldAttachDict(ZSTD_CCtx* cctx, && params.attachDictPref != ZSTD_dictForceCopy && !params.forceWindow /* dictMatchState isn't correctly * handled in _enforceMaxDist */ - && ZSTD_equivalentCParams(cctx->appliedParams.cParams, - cdict->matchState.cParams); + && ( (cdict->matchState.cParams.strategy <= ZSTD_fast) + || (cdict->matchState.cParams.strategy > ZSTD_fast && + ZSTD_equivalentCParams(cctx->appliedParams.cParams, + cdict->matchState.cParams))); } static size_t ZSTD_resetCCtx_byAttachingCDict(ZSTD_CCtx* cctx,