Skip to content

Commit

Permalink
restrict patchfrom speed optimization to strategy < ZSTD_btultra
Browse files Browse the repository at this point in the history
  • Loading branch information
daniellerozenblit committed Mar 13, 2023
1 parent 300a59d commit 8d0a06a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/compress/zstd_compress.c
Original file line number Diff line number Diff line change
Expand Up @@ -4687,7 +4687,8 @@ static size_t ZSTD_loadDictionaryContent(ZSTD_matchState_t* ms,
}

/* If the dict is larger than we can reasonably index in our tables, only load the suffix. */
{ U32 maxDictSize = 8U * (1U << MIN(MAX(params->cParams.hashLog, params->cParams.chainLog), 28));
if (params->cParams.strategy < ZSTD_btultra) {
U32 maxDictSize = 8U << MIN(MAX(params->cParams.hashLog, params->cParams.chainLog), 27);
if (srcSize > maxDictSize) {
ip = iend - maxDictSize;
src = ip;
Expand Down

0 comments on commit 8d0a06a

Please sign in to comment.