Skip to content

Commit

Permalink
Update the H5 hasher to use the H6's FN(STORE).
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 623885589
  • Loading branch information
Brotli authored and Copybara-Service committed Apr 11, 2024
1 parent f964a1e commit a813a6a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions c/enc/hash_longest_match_inc.h
Expand Up @@ -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,
Expand Down

0 comments on commit a813a6a

Please sign in to comment.