Move in-place functions below their iterator variants.
This commit is contained in:
parent
c86873bda4
commit
9aaaa6b31e
1 changed files with 24 additions and 24 deletions
|
@ -723,30 +723,6 @@ impl BitvSet {
|
|||
bitv.nbits = trunc_len * uint::BITS;
|
||||
}
|
||||
|
||||
/// Union in-place with the specified other bit vector
|
||||
#[inline]
|
||||
pub fn union_with(&mut self, other: &BitvSet) {
|
||||
self.other_op(other, |w1, w2| w1 | w2);
|
||||
}
|
||||
|
||||
/// Intersect in-place with the specified other bit vector
|
||||
#[inline]
|
||||
pub fn intersect_with(&mut self, other: &BitvSet) {
|
||||
self.other_op(other, |w1, w2| w1 & w2);
|
||||
}
|
||||
|
||||
/// Difference in-place with the specified other bit vector
|
||||
#[inline]
|
||||
pub fn difference_with(&mut self, other: &BitvSet) {
|
||||
self.other_op(other, |w1, w2| w1 & !w2);
|
||||
}
|
||||
|
||||
/// Symmetric difference in-place with the specified other bit vector
|
||||
#[inline]
|
||||
pub fn symmetric_difference_with(&mut self, other: &BitvSet) {
|
||||
self.other_op(other, |w1, w2| w1 ^ w2);
|
||||
}
|
||||
|
||||
/// Iterator over each uint stored in the BitvSet
|
||||
#[inline]
|
||||
pub fn iter<'a>(&'a self) -> BitPositions<'a> {
|
||||
|
@ -801,6 +777,30 @@ impl BitvSet {
|
|||
next_idx: 0
|
||||
}
|
||||
}
|
||||
|
||||
/// Union in-place with the specified other bit vector
|
||||
#[inline]
|
||||
pub fn union_with(&mut self, other: &BitvSet) {
|
||||
self.other_op(other, |w1, w2| w1 | w2);
|
||||
}
|
||||
|
||||
/// Intersect in-place with the specified other bit vector
|
||||
#[inline]
|
||||
pub fn intersect_with(&mut self, other: &BitvSet) {
|
||||
self.other_op(other, |w1, w2| w1 & w2);
|
||||
}
|
||||
|
||||
/// Difference in-place with the specified other bit vector
|
||||
#[inline]
|
||||
pub fn difference_with(&mut self, other: &BitvSet) {
|
||||
self.other_op(other, |w1, w2| w1 & !w2);
|
||||
}
|
||||
|
||||
/// Symmetric difference in-place with the specified other bit vector
|
||||
#[inline]
|
||||
pub fn symmetric_difference_with(&mut self, other: &BitvSet) {
|
||||
self.other_op(other, |w1, w2| w1 ^ w2);
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Show for BitvSet {
|
||||
|
|
Loading…
Reference in a new issue