Move in-place functions below their iterator variants.

This commit is contained in:
Jonas Hietala 2014-07-20 14:16:47 +02:00 committed by Alex Crichton
parent c86873bda4
commit 9aaaa6b31e

View file

@ -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 {