From: W. Felix Handte Date: Tue, 15 May 2018 17:13:19 +0000 (-0400) Subject: Also Attach Dict When Source Size is Unknown X-Git-Tag: v1.3.5~3^2~44^2~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7e0402e738f2e3ff6d74e63283bc7c514b67b3a4;p=thirdparty%2Fzstd.git Also Attach Dict When Source Size is Unknown --- diff --git a/lib/compress/zstd_compress.c b/lib/compress/zstd_compress.c index 9f488b9ac..4d4e171bc 100644 --- a/lib/compress/zstd_compress.c +++ b/lib/compress/zstd_compress.c @@ -1208,7 +1208,8 @@ static size_t ZSTD_resetCCtx_usingCDict(ZSTD_CCtx* cctx, * context, or referencing the dictionary context from the working context * in-place. We decide here which strategy to use. */ /* TODO: pick reasonable cut-off size, handle ZSTD_CONTENTSIZE_UNKNOWN */ - int attachDict = pledgedSrcSize <= 8 KB + int attachDict = ( pledgedSrcSize <= 8 KB + || pledgedSrcSize == ZSTD_CONTENTSIZE_UNKNOWN ) && cdict->cParams.strategy == ZSTD_fast && ZSTD_equivalentCParams(cctx->appliedParams.cParams, cdict->cParams);