]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
restored fast zstd_opt variant
authorYann Collet <yann.collet.73@gmail.com>
Wed, 10 Feb 2016 16:18:24 +0000 (17:18 +0100)
committerYann Collet <yann.collet.73@gmail.com>
Wed, 10 Feb 2016 16:18:24 +0000 (17:18 +0100)
lib/zstd_opt.h

index 579558b11df6f6a73e8ad2cf55659914c1cbb38f..6fb94e21aa59eb461943ef62b3e7990a25d876c1 100644 (file)
@@ -350,8 +350,8 @@ U32 ZSTD_HcGetAllMatches_generic (
         nbAttempts--;
         if ((!extDict) || matchIndex >= dictLimit) {
             match = base + matchIndex;
-            //if (match[minml] == ip[minml]) currentMl = ZSTD_count(ip, match, iHighLimit); if (currentMl>0) {   // faster
-             if (MEM_read32(match) == MEM_read32(ip)) { currentMl = ZSTD_count(ip+MINMATCH, match+MINMATCH, iHighLimit)+MINMATCH;  // stronger
+            if (match[minml] == ip[minml]) currentMl = ZSTD_count(ip, match, iHighLimit); if (currentMl>0) {   // faster
+            //if (MEM_read32(match) == MEM_read32(ip)) { currentMl = ZSTD_count(ip+MINMATCH, match+MINMATCH, iHighLimit)+MINMATCH;  // stronger
                 while ((match-back > base) && (ip-back > iLowLimit) && (ip[-back-1] == match[-back-1])) back++;
                 currentMl += back;
             }