From 991d660ea9fc0e0453a6fa580831352478b56104 Mon Sep 17 00:00:00 2001 From: "W. Felix Handte" Date: Wed, 18 Aug 2021 16:15:53 -0400 Subject: [PATCH] Nit: Only Store 2 Hash Variables --- lib/compress/zstd_fast.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/lib/compress/zstd_fast.c b/lib/compress/zstd_fast.c index f731b957d12..c43c8a6af1e 100644 --- a/lib/compress/zstd_fast.c +++ b/lib/compress/zstd_fast.c @@ -255,7 +255,6 @@ ZSTD_compressBlock_fast_generic_pipelined( size_t hash0; /* hash for ip0 */ size_t hash1; /* hash for ip1 */ - size_t hash2; /* hash for ip2 */ U32 idx; /* match idx for ip0 */ U32 mval; /* src value at match idx */ @@ -327,11 +326,13 @@ ZSTD_compressBlock_fast_generic_pipelined( goto _offset; } + hash0 = hash1; + /* hash ip[2] */ - hash2 = ZSTD_hashPtr(ip2, hlog, mls); + hash1 = ZSTD_hashPtr(ip2, hlog, mls); /* lookup ip[1] */ - idx = hashTable[hash1]; + idx = hashTable[hash0]; /* advance to next positions */ { @@ -341,9 +342,6 @@ ZSTD_compressBlock_fast_generic_pipelined( nextStep += kStepIncr; } - hash0 = hash1; - hash1 = hash2; - ip0 = ip1; ip1 = ip2; ip2 = ip2 + step;