What's the most efficient way to compare two bit vectors? In Objective-C, I'm using CFBitVectors and simply comparing each bit in both:
for (CFIndex bitIndex = 0; bitIndex < numBits; bitIndex++) {
if (CFBitVectorGetBitAtIndex(thisVector, bitIndex) != CFBitVectorGetBitAtIndex(thatVector, bitIndex)) {
return NO;
}
}
return YES;
Which works fine, but I wasn't sure if there wasn't some more efficient way to do it using bit operators.