diff options
| author | Jonas Hietala <tradet.h@gmail.com> | 2014-07-20 14:16:47 +0200 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2014-07-21 09:54:31 -0700 |
| commit | 9aaaa6b31e644f174051e30a48ec6fa350e7591d (patch) | |
| tree | 25b2875d5dfe46b935b3b95a76ab26f97071f68d | |
| parent | c86873bda4d0d32a595dbaf24745c1f7cd9b89da (diff) | |
| download | rust-9aaaa6b31e644f174051e30a48ec6fa350e7591d.tar.gz rust-9aaaa6b31e644f174051e30a48ec6fa350e7591d.zip | |
Move in-place functions below their iterator variants.
| -rw-r--r-- | src/libcollections/bitv.rs | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/src/libcollections/bitv.rs b/src/libcollections/bitv.rs index 226da13f9e2..094a65b24bb 100644 --- a/src/libcollections/bitv.rs +++ b/src/libcollections/bitv.rs @@ -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 { |
