summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorYann Collet <cyan@fb.com>2017-11-02 22:05:45 (GMT)
committerYann Collet <cyan@fb.com>2017-11-02 22:05:45 (GMT)
commitbd992f12e4be48b4eed48b3898153f2c80bc014b (patch)
tree31911ac1860ca928046fdd152d4669b1eb94c892 /lib
parent8e16eb0cd164071d3fc4c18e0f10527487649e93 (diff)
downloadlz4-bd992f12e4be48b4eed48b3898153f2c80bc014b.zip
lz4-bd992f12e4be48b4eed48b3898153f2c80bc014b.tar.gz
lz4-bd992f12e4be48b4eed48b3898153f2c80bc014b.tar.bz2
searching match leading strictly farther does not work
sometimes, it's better to re-use same match but start it later, in order to get shorter matchlength code
Diffstat (limited to 'lib')
-rw-r--r--lib/lz4opt.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/lz4opt.h b/lib/lz4opt.h
index 25ceaad..1e696f9 100644
--- a/lib/lz4opt.h
+++ b/lib/lz4opt.h
@@ -318,7 +318,7 @@ 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 + 1, matches, fullUpdate); /* only works if last_match_pos is really the last match pos */
+ //nb_matches = LZ4HC_HashChain_GetAllMatches(ctx, curPtr, matchlimit, last_match_pos - cur - 1, matches, fullUpdate); /* only test matches of a minimum length */
if (!nb_matches) continue;
if ( ((size_t)matches[nb_matches-1].len > sufficient_len)