From eaeb7f00b5dea51b3e39175cee930bef0b0e16eb Mon Sep 17 00:00:00 2001 From: Yann Collet Date: Fri, 12 Jul 2019 14:17:17 -0700 Subject: [PATCH] updated the _extDict variant of double fast --- lib/compress/zstd_double_fast.c | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/lib/compress/zstd_double_fast.c b/lib/compress/zstd_double_fast.c index b65fd41e7..5957255d9 100644 --- a/lib/compress/zstd_double_fast.c +++ b/lib/compress/zstd_double_fast.c @@ -463,20 +463,12 @@ static size_t ZSTD_compressBlock_doubleFast_extDict_generic( /* 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 */ while (ip <= ilimit) { U32 const current2 = (U32)(ip-base); -- 2.47.2