From 48413765b4a59a1ad40b731e0ffe0f203ca27f60 Mon Sep 17 00:00:00 2001 From: inikep Date: Tue, 8 Mar 2016 11:03:55 +0100 Subject: [PATCH] fixed update of hashTable for matches with length of 4+ --- lib/zstd_opt.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/zstd_opt.h b/lib/zstd_opt.h index 68a3c315a..961964bd2 100644 --- a/lib/zstd_opt.h +++ b/lib/zstd_opt.h @@ -227,7 +227,6 @@ static U32 ZSTD_insertBtAndGetAllMatches ( const U32 minMatch = (mls == 3) ? 3 : 4; size_t bestLength = minMatch-1; - hashTable[h] = current; /* Update Hash Table */ if (minMatch == 3) { /* HC3 match finder */ U32 matchIndex3 = ZSTD_insertAndFindFirstIndexHash3 (zc, ip); @@ -256,6 +255,8 @@ static U32 ZSTD_insertBtAndGetAllMatches ( } } + hashTable[h] = current; /* Update Hash Table */ + while (nbCompares-- && (matchIndex > windowLow)) { U32* nextPtr = bt + 2*(matchIndex & btMask); size_t matchLength = MIN(commonLengthSmaller, commonLengthLarger); /* guaranteed minimum nb of common bytes */ -- 2.47.2