Intersect this Element with RHS and return true if this one changed. BecameZero is set to true if this element became all-zero bits.
| 192 | // Intersect this Element with RHS and return true if this one changed. |
| 193 | // BecameZero is set to true if this element became all-zero bits. |
| 194 | bool intersectWith(const SparseBitVectorElement &RHS, |
| 195 | bool &BecameZero) { |
| 196 | bool changed = false; |
| 197 | bool allzero = true; |
| 198 | |
| 199 | BecameZero = false; |
| 200 | for (unsigned i = 0; i < BITWORDS_PER_ELEMENT; ++i) { |
| 201 | BitWord old = changed ? 0 : Bits[i]; |
| 202 | |
| 203 | Bits[i] &= RHS.Bits[i]; |
| 204 | if (Bits[i] != 0) |
| 205 | allzero = false; |
| 206 | |
| 207 | if (!changed && old != Bits[i]) |
| 208 | changed = true; |
| 209 | } |
| 210 | BecameZero = allzero; |
| 211 | return changed; |
| 212 | } |
| 213 | |
| 214 | // Intersect this Element with the complement of RHS and return true if this |
| 215 | // one changed. BecameZero is set to true if this element became all-zero |