summaryrefslogtreecommitdiffstats
path: root/lib/lz4hc.c
diff options
context:
space:
mode:
authorYann Collet <cyan@fb.com>2018-02-11 10:45:36 (GMT)
committerYann Collet <cyan@fb.com>2018-02-11 10:45:36 (GMT)
commit2b674bf02f698b565b4525a36cdf4651899b88d1 (patch)
tree46f68d95b0745f4208a861af8ca93125c617e029 /lib/lz4hc.c
parentf76ee4e267e567bbce611aecd91f41b5de3b44d5 (diff)
downloadlz4-2b674bf02f698b565b4525a36cdf4651899b88d1.zip
lz4-2b674bf02f698b565b4525a36cdf4651899b88d1.tar.gz
lz4-2b674bf02f698b565b4525a36cdf4651899b88d1.tar.bz2
slightly improved hc compression speed (+~1-2%)
by removing bad candidates faster.
Diffstat (limited to 'lib/lz4hc.c')
-rw-r--r--lib/lz4hc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/lz4hc.c b/lib/lz4hc.c
index cface81..9f59e80 100644
--- a/lib/lz4hc.c
+++ b/lib/lz4hc.c
@@ -220,7 +220,7 @@ LZ4_FORCE_INLINE int LZ4HC_InsertAndGetWiderMatch (
nbAttempts--;
if (matchIndex >= dictLimit) {
const BYTE* const matchPtr = base + matchIndex;
- if (*(iLowLimit + longest) == *(matchPtr - delta + longest)) {
+ if (LZ4_read16(iLowLimit + longest - 1) == LZ4_read16(matchPtr - delta + longest - 1)) {
if (LZ4_read32(matchPtr) == pattern) {
int mlt = MINMATCH + LZ4_count(ip+MINMATCH, matchPtr+MINMATCH, iHighLimit);
#if 0