Test, Reset, and Set a bit in the bitmap.
| 469 | |
| 470 | // Test, Reset, and Set a bit in the bitmap. |
| 471 | bool test(unsigned Idx) const { |
| 472 | if (Elements.empty()) |
| 473 | return false; |
| 474 | |
| 475 | unsigned ElementIndex = Idx / ElementSize; |
| 476 | ElementListConstIter ElementIter = FindLowerBoundConst(ElementIndex); |
| 477 | |
| 478 | // If we can't find an element that is supposed to contain this bit, there |
| 479 | // is nothing more to do. |
| 480 | if (ElementIter == Elements.end() || |
| 481 | ElementIter->index() != ElementIndex) |
| 482 | return false; |
| 483 | return ElementIter->test(Idx % ElementSize); |
| 484 | } |
| 485 | |
| 486 | void reset(unsigned Idx) { |
| 487 | if (Elements.empty()) |