File tree Expand file tree Collapse file tree 2 files changed +20
-2
lines changed
branches/try2/src/libcollections Expand file tree Collapse file tree 2 files changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
5
5
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
7
7
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8
- refs/heads/try2: 40c45169b7b280bbe27380fc5f1c350d25946ec2
8
+ refs/heads/try2: dcccf824b1096cc596671724ebf42b8d3ed35705
9
9
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
10
10
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
11
11
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
Original file line number Diff line number Diff line change @@ -1522,7 +1522,7 @@ impl Set<uint> for BitvSet {
1522
1522
1523
1523
#[ inline]
1524
1524
fn is_disjoint ( & self , other : & BitvSet ) -> bool {
1525
- self . intersection ( other) . count ( ) > 0
1525
+ self . intersection ( other) . next ( ) . is_none ( )
1526
1526
}
1527
1527
1528
1528
#[ inline]
@@ -2264,6 +2264,24 @@ mod tests {
2264
2264
assert ! ( set1. is_subset( & set2) ) ; // { 2 } { 2, 4 }
2265
2265
}
2266
2266
2267
+ #[ test]
2268
+ fn test_bitv_set_is_disjoint ( ) {
2269
+ let a = BitvSet :: from_bitv ( from_bytes ( [ 0b10100010 ] ) ) ;
2270
+ let b = BitvSet :: from_bitv ( from_bytes ( [ 0b01000000 ] ) ) ;
2271
+ let c = BitvSet :: new ( ) ;
2272
+ let d = BitvSet :: from_bitv ( from_bytes ( [ 0b00110000 ] ) ) ;
2273
+
2274
+ assert ! ( !a. is_disjoint( & d) ) ;
2275
+ assert ! ( !d. is_disjoint( & a) ) ;
2276
+
2277
+ assert ! ( a. is_disjoint( & b) )
2278
+ assert ! ( a. is_disjoint( & c) )
2279
+ assert ! ( b. is_disjoint( & a) )
2280
+ assert ! ( b. is_disjoint( & c) )
2281
+ assert ! ( c. is_disjoint( & a) )
2282
+ assert ! ( c. is_disjoint( & b) )
2283
+ }
2284
+
2267
2285
#[ test]
2268
2286
fn test_bitv_set_intersect_with ( ) {
2269
2287
// Explicitly 0'ed bits
You can’t perform that action at this time.
0 commit comments