mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-03 00:31:50 +00:00
Add num_bytes() to bitfield
This commit is contained in:
@@ -86,6 +86,9 @@ impl BooleanBitfield {
|
||||
/// vector.
|
||||
pub fn is_empty(&self) -> bool { self.len == 0 }
|
||||
|
||||
/// The number of bytes required to represent the bitfield.
|
||||
pub fn num_bytes(&self) -> usize { self.vec.len() }
|
||||
|
||||
/// Iterate through the underlying vector and count the number of
|
||||
/// true bits.
|
||||
pub fn num_true_bits(&self) -> u64 {
|
||||
|
||||
Reference in New Issue
Block a user