mozilla/rust — pull request #4546 by alexcrichton (2013-01-20 01:24:45+00:00)
Title: Fix the difference method on bit vectors

I was looking into the `difference` method on the bit vector implementations, and I found that it didn't quite align with what I thought of as the difference between two sets.

For `SmallBitv`, the difference was just the xor of the two vectors, which I'm not really sure what it's supposed to represent. For `BigBitv`, it almost did the difference except that it added in lots of bits which weren't related to the two bit vectors.

I figured that the difference method should return the set-wise difference:
```
A / B = { x : x in A and x not in B }
```
so I updated both of the difference methods to do that and added some tests to do that. If this isn't right, the two implementations (SmallBitv/BigBitv) appear to do different things, so they should probably be unified to one thing anyway.