Skip to content

Commit

Permalink
Nit: Only Store 2 Hash Variables
Browse files Browse the repository at this point in the history
  • Loading branch information
felixhandte committed Sep 1, 2021
1 parent 8706bc1 commit 991d660
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions lib/compress/zstd_fast.c
Expand Up @@ -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 */

Expand Down Expand Up @@ -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 */
{
Expand All @@ -341,9 +342,6 @@ ZSTD_compressBlock_fast_generic_pipelined(
nextStep += kStepIncr;
}

hash0 = hash1;
hash1 = hash2;

ip0 = ip1;
ip1 = ip2;
ip2 = ip2 + step;
Expand Down

0 comments on commit 991d660

Please sign in to comment.