Return a begin iterator
| 633 | |
| 634 | /// Return a begin iterator |
| 635 | Iterator begin() const { |
| 636 | |
| 637 | // If the set is empty |
| 638 | if (size() == 0) { |
| 639 | |
| 640 | // Return an iterator to the end |
| 641 | return end(); |
| 642 | } |
| 643 | |
| 644 | // Find the first used entry |
| 645 | uint64 bucketIndex = 0; |
| 646 | while (mBuckets[bucketIndex] == INVALID_INDEX) { |
| 647 | |
| 648 | bucketIndex++; |
| 649 | } |
| 650 | |
| 651 | assert(bucketIndex < mHashSize); |
| 652 | assert(mBuckets[bucketIndex] != INVALID_INDEX); |
| 653 | |
| 654 | return Iterator(this, bucketIndex, mBuckets[bucketIndex]); |
| 655 | } |
| 656 | |
| 657 | /// Return a end iterator |
| 658 | Iterator end() const { |