Add `KeyAddrBitField::clear()` method

Signed-off-by: Michael Richters <gedankenexperimenter@gmail.com>
pull/1024/head
Michael Richters 4 years ago
parent 73c9fa7e96
commit 328edcfc64
No known key found for this signature in database
GPG Key ID: 1288FD13E4EEF0C0

@ -70,6 +70,9 @@ class KeyAddrBitfield {
// assert(k.toInt() < size); // assert(k.toInt() < size);
bitWrite(data_[blockIndex(k)], bitIndex(k), value); bitWrite(data_[blockIndex(k)], bitIndex(k), value);
} }
void clear() {
memset(data_, 0, sizeof(data_));
}
// This function returns the number of set bits in the bitfield up to and // This function returns the number of set bits in the bitfield up to and
// including the bit at index `k`. Two important things to note: it doesn't // including the bit at index `k`. Two important things to note: it doesn't

Loading…
Cancel
Save