Return a begin iterator
| 662 | |
| 663 | /// Return a begin iterator |
| 664 | Iterator begin() const { |
| 665 | |
| 666 | // If the map is empty |
| 667 | if (size() == 0) { |
| 668 | |
| 669 | // Return an iterator to the end |
| 670 | return end(); |
| 671 | } |
| 672 | |
| 673 | // Find the first used entry |
| 674 | uint64 bucketIndex = 0; |
| 675 | while (mBuckets[bucketIndex] == INVALID_INDEX) { |
| 676 | |
| 677 | bucketIndex++; |
| 678 | } |
| 679 | |
| 680 | assert(bucketIndex < mHashSize); |
| 681 | assert(mBuckets[bucketIndex] != INVALID_INDEX); |
| 682 | |
| 683 | return Iterator(this, bucketIndex, mBuckets[bucketIndex]); |
| 684 | } |
| 685 | |
| 686 | /// Return a end iterator |
| 687 | Iterator end() const { |