Skip to content

Commit

Permalink
[bitvec] remove unneeded dead code attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
phlip9 authored and bors-libra committed Sep 24, 2021
1 parent 44dddd4 commit 183446c
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions common/bitvec/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ pub struct BitVec {
}

impl BitVec {
// TODO(abhayb): Remove after migration to new wire format.
#[allow(dead_code)]
/// Sets the bit at position @pos.
pub fn set(&mut self, pos: u8) {
// This is optimised to: let bucket = pos >> 3;
Expand All @@ -74,8 +72,6 @@ impl BitVec {
self.inner[bucket] |= 0b1000_0000 >> bucket_pos as u8;
}

// TODO(abhayb): Remove after migration to new wire format.
#[allow(dead_code)]
/// Checks if the bit at position @pos is set.
pub fn is_set(&self, pos: u8) -> bool {
// This is optimised to: let bucket = pos >> 3;
Expand All @@ -88,15 +84,11 @@ impl BitVec {
(self.inner[bucket] & (0b1000_0000 >> bucket_pos as u8)) != 0
}

// TODO(kostas): Remove after applying it to multi-sig.
#[allow(dead_code)]
/// Returns the number of set bits.
pub fn count_ones(&self) -> u32 {
self.inner.iter().map(|a| a.count_ones()).sum()
}

// TODO(kostas): Remove after applying it to multi-sig.
#[allow(dead_code)]
/// Returns the index of the last set bit.
pub fn last_set_bit(&self) -> Option<u8> {
self.inner
Expand Down

0 comments on commit 183446c

Please sign in to comment.