public void XOr(BitSet bs) {
if (bs == null) {
throw new ArgumentNullException("bs");
}
// Calculate how many words with have in common with the other bit set.
Int32 wordsInCommon = Math.Min(this._wordsInUse, bs._wordsInUse);
if (this._wordsInUse < bs._wordsInUse) {
this.EnsureCapacity(bs._wordsInUse);
this._wordsInUse = bs._wordsInUse;
}
// Perform logical XOR on words in common.
for (Int32 i = 0; i < wordsInCommon; i++) {
this._bits[i] ^= bs._bits[i];
}
// Copy any remaining words.
if (wordsInCommon < bs._wordsInUse) {
Array.Copy(bs._bits, wordsInCommon, this._bits, wordsInCommon, bs._wordsInUse - wordsInCommon);
}
this.RecalculateWordsInUse();
this.CheckInvariants();
}