Skip to content

Commit

Permalink
Bug 1828560 - Part 2: Rename BitBloomFilter::mCounters to mBits. r=dp…
Browse files Browse the repository at this point in the history
…almeiro

Depends on D175722

Differential Revision: https://phabricator.services.mozilla.com/D175723
  • Loading branch information
arai-a committed Apr 19, 2023
1 parent 9f15f5e commit ffd575a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions mfbt/BloomFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,14 +148,14 @@ class BitBloomFilter {
uint32_t index = aHash / 8;
uint8_t shift = aHash % 8;
uint8_t mask = 1 << shift;
return !!(mCounters[index] & mask);
return !!(mBits[index] & mask);
}

void setSlot(uint32_t aHash) {
uint32_t index = aHash / 8;
uint8_t shift = aHash % 8;
uint8_t bit = 1 << shift;
mCounters[index] |= bit;
mBits[index] |= bit;
}

bool getFirstSlot(uint32_t aHash) const { return getSlot(hash1(aHash)); }
Expand All @@ -164,12 +164,12 @@ class BitBloomFilter {
void setFirstSlot(uint32_t aHash) { setSlot(hash1(aHash)); }
void setSecondSlot(uint32_t aHash) { setSlot(hash2(aHash)); }

uint8_t mCounters[kArraySize];
uint8_t mBits[kArraySize];
};

template <unsigned KeySize, class T>
inline void BitBloomFilter<KeySize, T>::clear() {
memset(mCounters, 0, kArraySize);
memset(mBits, 0, kArraySize);
}

template <unsigned KeySize, class T>
Expand Down

0 comments on commit ffd575a

Please sign in to comment.