Skip to content

Commit

Permalink
remove unused
Browse files Browse the repository at this point in the history
  • Loading branch information
Szegoo committed Feb 3, 2024
1 parent a59c672 commit 0dbc312
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions primitives/src/coretime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,6 @@ impl CoreMask {
pub fn count_ones(&self) -> u32 {
self.0.iter().map(|i| i.count_ones()).sum()
}
// TODO: write test
pub fn count_zeros_from(&self, from: usize) -> u32 {
let total_bits = self.0.len() * 8;
(from..total_bits).filter(|&i| !self.is_bit_set(i)).count() as u32
}
pub fn count_ones_from(&self, from: usize) -> u32 {
let total_bits = self.0.len() * 8;
(from..total_bits).filter(|&i| self.is_bit_set(i)).count() as u32
}
fn is_bit_set(&self, index: usize) -> bool {
let byte_index = index / 8;
let bit_index = index % 8;
Expand Down

0 comments on commit 0dbc312

Please sign in to comment.