Skip to content

Commit

Permalink
Use Block::is_empty properly
Browse files Browse the repository at this point in the history
  • Loading branch information
james7132 committed Mar 18, 2024
1 parent 378a7bf commit 648d906
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,7 @@ impl FixedBitSet {
self.data
.iter()
.zip(other.data.iter())
.all(|(x, y)| *x & *y == Block::NONE)
.all(|(x, y)| (*x & *y).is_empty())
}

/// Returns `true` if the set is a subset of another, i.e. `other` contains
Expand All @@ -693,12 +693,12 @@ impl FixedBitSet {
self.data
.iter()
.zip(other.data.iter())
.all(|(x, y)| x.andnot(*y) == Block::NONE)
.all(|(x, y)| x.andnot(*y).is_empty())
&& self
.data
.iter()
.skip(other.data.len())
.all(|x| *x == Block::NONE)
.all(|x| x.is_empty())
}

/// Returns `true` if the set is a superset of another, i.e. `self` contains
Expand Down

0 comments on commit 648d906

Please sign in to comment.