| 639 | } |
| 640 | |
| 641 | ALWAYS_INLINE size_t FirstAvailableSlot(size_t index) const { |
| 642 | DCHECK_LT(index, NumBuckets()); // Don't try to get a slot out of range. |
| 643 | size_t non_empty_count = 0; |
| 644 | while (!emptyfn_.IsEmpty(data_[index])) { |
| 645 | index = NextIndex(index); |
| 646 | non_empty_count++; |
| 647 | DCHECK_LE(non_empty_count, NumBuckets()); // Don't loop forever. |
| 648 | } |
| 649 | return index; |
| 650 | } |
| 651 | |
| 652 | // Return new offset. |
| 653 | template <typename Elem> |