aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrotli <no-reply@google.com>2024-04-11 11:23:08 -0700
committerCopybara-Service <copybara-worker@google.com>2024-04-11 11:23:47 -0700
commita813a6a1e43650f6ee5ab590051a218bcb958352 (patch)
tree86d70a45aa081e816ccf345410a026fb4a9c9deb
parentf964a1e8acc8431e17f179b0b3e7cacefe1a9230 (diff)
downloadbrotli-a813a6a1e43650f6ee5ab590051a218bcb958352.zip
brotli-a813a6a1e43650f6ee5ab590051a218bcb958352.tar.gz
brotli-a813a6a1e43650f6ee5ab590051a218bcb958352.tar.bz2
Update the `H5` hasher to use the `H6`'s `FN(STORE)`.
PiperOrigin-RevId: 623885589
-rw-r--r--c/enc/hash_longest_match_inc.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/c/enc/hash_longest_match_inc.h b/c/enc/hash_longest_match_inc.h
index 608fa66..c25cdb0 100644
--- a/c/enc/hash_longest_match_inc.h
+++ b/c/enc/hash_longest_match_inc.h
@@ -104,11 +104,13 @@ static BROTLI_INLINE void FN(HashMemAllocInBytes)(
static BROTLI_INLINE void FN(Store)(
HashLongestMatch* BROTLI_RESTRICT self, const uint8_t* BROTLI_RESTRICT data,
const size_t mask, const size_t ix) {
+ uint16_t* BROTLI_RESTRICT num = self->num_;
+ uint32_t* BROTLI_RESTRICT buckets = self->buckets_;
const uint32_t key = FN(HashBytes)(&data[ix & mask], self->hash_shift_);
- const size_t minor_ix = self->num_[key] & self->block_mask_;
+ const size_t minor_ix = num[key] & self->block_mask_;
const size_t offset = minor_ix + (key << self->block_bits_);
- self->buckets_[offset] = (uint32_t)ix;
- ++self->num_[key];
+ ++num[key];
+ buckets[offset] = (uint32_t)ix;
}
static BROTLI_INLINE void FN(StoreRange)(HashLongestMatch* BROTLI_RESTRICT self,