Union this element with RHS and return true if this one changed.
| 403 | |
| 404 | // Union this element with RHS and return true if this one changed. |
| 405 | bool unionWith(const SparseBitVectorElement &RHS) |
| 406 | { |
| 407 | bool changed = false; |
| 408 | for (unsigned i = 0; i < BITWORDS_PER_ELEMENT; ++i) |
| 409 | { |
| 410 | BitWord old = changed ? 0 : Bits[i]; |
| 411 | |
| 412 | Bits[i] |= RHS.Bits[i]; |
| 413 | if (!changed && old != Bits[i]) |
| 414 | changed = true; |
| 415 | } |
| 416 | return changed; |
| 417 | } |
| 418 | |
| 419 | // Return true if we have any bits in common with RHS |
| 420 | bool intersects(const SparseBitVectorElement &RHS) const |