slightly improved hc compression speed (+~1-2%)
authorYann Collet <cyan@fb.com>
Sun, 11 Feb 2018 10:45:36 +0000 (02:45 -0800)
committerYann Collet <cyan@fb.com>
Sun, 11 Feb 2018 10:45:36 +0000 (02:45 -0800)
by removing bad candidates faster.

lib/lz4hc.c

index cface81..9f59e80 100644 (file)
@@ -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