Union this element with RHS and return true if this one changed.
| 169 | |
| 170 | // Union this element with RHS and return true if this one changed. |
| 171 | bool unionWith(const SparseBitVectorElement &RHS) { |
| 172 | bool changed = false; |
| 173 | for (unsigned i = 0; i < BITWORDS_PER_ELEMENT; ++i) { |
| 174 | BitWord old = changed ? 0 : Bits[i]; |
| 175 | |
| 176 | Bits[i] |= RHS.Bits[i]; |
| 177 | if (!changed && old != Bits[i]) |
| 178 | changed = true; |
| 179 | } |
| 180 | return changed; |
| 181 | } |
| 182 | |
| 183 | // Return true if we have any bits in common with RHS |
| 184 | bool intersects(const SparseBitVectorElement &RHS) const { |