]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
double-fast: changed the trade-off for a smaller positive change
authorYann Collet <cyan@fb.com>
Fri, 12 Jul 2019 18:34:53 +0000 (11:34 -0700)
committerYann Collet <cyan@fb.com>
Fri, 12 Jul 2019 18:34:53 +0000 (11:34 -0700)
same number of complementary insertions, just organized differently
(long at `ip-2`, short at `ip-1`).

.gitignore
lib/compress/zstd_double_fast.c

index 0c840b6b67b94d89d4ea8c9f9c37761be41cc362..4c297053b49477570ec04a0f43833dcfc01ccb4e 100644 (file)
@@ -14,7 +14,7 @@
 *.dylib
 
 # Executables
-zstd.
+/zstd
 zstdmt
 *.exe
 *.out
index bdb26ef80eee74e0f44d12835f92796c7e8c4c9d..b65fd41e74219a9e7ed492c789489fb27048c560 100644 (file)
@@ -257,19 +257,10 @@ _match_stored:
             /* Complementary insertion */
             /* done after iLimit test, as candidates could be > iend-8 */
             {   U32 const indexToInsert = current+2;
-                hashLong[ZSTD_hashPtr(base+indexToInsert, hBitsL, 8)] =
-                    hashSmall[ZSTD_hashPtr(base+indexToInsert, hBitsS, mls)] =
-                        indexToInsert;
-            }
-            {   const BYTE* const ipToInsert = ip - 2;
-                hashLong[ZSTD_hashPtr(ipToInsert, hBitsL, 8)] =
-                    hashSmall[ZSTD_hashPtr(ipToInsert, hBitsS, mls)] =
-                        (U32)(ipToInsert-base);
-            }
-            {   const BYTE* const ipToInsert = ip - 1;
-                hashLong[ZSTD_hashPtr(ipToInsert, hBitsL, 8)] =
-                    hashSmall[ZSTD_hashPtr(ipToInsert, hBitsS, mls)] =
-                        (U32)(ipToInsert-base);
+                hashLong[ZSTD_hashPtr(base+indexToInsert, hBitsL, 8)] = indexToInsert;
+                hashLong[ZSTD_hashPtr(ip-2, hBitsL, 8)] = (U32)(ip-2-base);
+                hashSmall[ZSTD_hashPtr(base+indexToInsert, hBitsS, mls)] = indexToInsert;
+                hashSmall[ZSTD_hashPtr(ip-1, hBitsS, mls)] = (U32)(ip-1-base);
             }
 
             /* check immediate repcode */