From: Yann Collet Date: Fri, 12 Jul 2019 18:34:53 +0000 (-0700) Subject: double-fast: changed the trade-off for a smaller positive change X-Git-Tag: v1.4.1^2~4^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e8a7f5d3ce0ebb36e4ad850ab12463b1127dba17;p=thirdparty%2Fzstd.git double-fast: changed the trade-off for a smaller positive change same number of complementary insertions, just organized differently (long at `ip-2`, short at `ip-1`). --- diff --git a/.gitignore b/.gitignore index 0c840b6b6..4c297053b 100644 --- a/.gitignore +++ b/.gitignore @@ -14,7 +14,7 @@ *.dylib # Executables -zstd. +/zstd zstdmt *.exe *.out diff --git a/lib/compress/zstd_double_fast.c b/lib/compress/zstd_double_fast.c index bdb26ef80..b65fd41e7 100644 --- a/lib/compress/zstd_double_fast.c +++ b/lib/compress/zstd_double_fast.c @@ -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 */