about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJonas Hietala <tradet.h@gmail.com>2014-07-20 14:18:04 +0200
committerAlex Crichton <alex@alexcrichton.com>2014-07-21 09:54:31 -0700
commit2e40078fc3325f336b1e0d27313d67ad6ae19419 (patch)
tree9d178b64de6d40fec0ef52cb066788cc30febbc8
parent9aaaa6b31e644f174051e30a48ec6fa350e7591d (diff)
downloadrust-2e40078fc3325f336b1e0d27313d67ad6ae19419.tar.gz
rust-2e40078fc3325f336b1e0d27313d67ad6ae19419.zip
Place union as the first function, for consistency.
-rw-r--r--src/libcollections/bitv.rs24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/libcollections/bitv.rs b/src/libcollections/bitv.rs
index 094a65b24bb..3521c4df6e7 100644
--- a/src/libcollections/bitv.rs
+++ b/src/libcollections/bitv.rs
@@ -729,6 +729,18 @@ impl BitvSet {
         BitPositions {set: self, next_idx: 0}
     }
 
+    /// Iterator over each uint stored in `self` union `other`
+    #[inline]
+    pub fn union<'a>(&'a self, other: &'a BitvSet) -> TwoBitPositions<'a> {
+        TwoBitPositions {
+            set: self,
+            other: other,
+            merge: |w1, w2| w1 | w2,
+            current_word: 0,
+            next_idx: 0
+        }
+    }
+
     /// Iterator over each uint stored in the `self` setminus `other`
     #[inline]
     pub fn difference<'a>(&'a self, other: &'a BitvSet) -> TwoBitPositions<'a> {
@@ -766,18 +778,6 @@ impl BitvSet {
         }.take(min)
     }
 
-    /// Iterator over each uint stored in `self` union `other`
-    #[inline]
-    pub fn union<'a>(&'a self, other: &'a BitvSet) -> TwoBitPositions<'a> {
-        TwoBitPositions {
-            set: self,
-            other: other,
-            merge: |w1, w2| w1 | w2,
-            current_word: 0,
-            next_idx: 0
-        }
-    }
-
     /// Union in-place with the specified other bit vector
     #[inline]
     pub fn union_with(&mut self, other: &BitvSet) {