summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorYann Collet <cyan@fb.com>2017-11-03 07:59:05 (GMT)
committerYann Collet <cyan@fb.com>2017-11-03 07:59:05 (GMT)
commit82c1aed41927d0d3400ab91f975c2e163ecdcc1d (patch)
tree0bcb8c3dda47052168550b5df2588802f946277e /lib
parent890c0553d08ad6a6a4f2801523667413b5477512 (diff)
downloadlz4-82c1aed41927d0d3400ab91f975c2e163ecdcc1d.zip
lz4-82c1aed41927d0d3400ab91f975c2e163ecdcc1d.tar.gz
lz4-82c1aed41927d0d3400ab91f975c2e163ecdcc1d.tar.bz2
improved level 11 speed
Diffstat (limited to 'lib')
-rw-r--r--lib/lz4opt.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/lz4opt.h b/lib/lz4opt.h
index edcfc10..c754865 100644
--- a/lib/lz4opt.h
+++ b/lib/lz4opt.h
@@ -324,8 +324,10 @@ static int LZ4HC_compress_optimal (
DEBUGLOG(7, "search at rPos:%u", cur);
//nb_matches = LZ4HC_BinTree_GetAllMatches(ctx, curPtr, matchlimit, MINMATCH-1, matches, fullUpdate);
- nb_matches = LZ4HC_HashChain_GetAllMatches(ctx, curPtr, matchlimit, MINMATCH-1, matches, fullUpdate);
- //nb_matches = LZ4HC_HashChain_GetAllMatches(ctx, curPtr, matchlimit, last_match_pos - cur, matches, fullUpdate); /* only test matches of a minimum length */
+ if (fullUpdate)
+ nb_matches = LZ4HC_HashChain_GetAllMatches(ctx, curPtr, matchlimit, MINMATCH-1, matches, fullUpdate);
+ else
+ nb_matches = LZ4HC_HashChain_GetAllMatches(ctx, curPtr, matchlimit, last_match_pos - cur, matches, fullUpdate); /* only test matches of a minimum length; slightly faster, but misses a few bytes */
if (!nb_matches) continue;
if ( ((size_t)matches[nb_matches-1].len > sufficient_len)