Lines Matching refs:index

66     Iterator(HashSet* hash_set, size_t index) : hash_set_(hash_set), index_(index) {  in Iterator()  argument
107 size_t NextNonEmptySlot(size_t index) const { in NextNonEmptySlot() argument
109 DCHECK_LT(index, num_buckets); in NextNonEmptySlot()
111 ++index; in NextNonEmptySlot()
112 } while (index < num_buckets && hash_set_->IsFreeSlot(index)); in NextNonEmptySlot()
113 return index; in NextNonEmptySlot()
238 size_t index = IndexForHash(hash); in FindWithHash() local
240 T& slot = ElementForIndex(index); in FindWithHash()
245 return Iterator(this, index); in FindWithHash()
247 index = NextIndex(index); in FindWithHash()
260 const size_t index = FirstAvailableSlot(IndexForHash(hash)); in InsertWithHash() local
261 data_[index] = element; in InsertWithHash()
312 T& ElementForIndex(size_t index) { in ElementForIndex() argument
313 DCHECK_LT(index, NumBuckets()); in ElementForIndex()
315 return data_[index]; in ElementForIndex()
317 const T& ElementForIndex(size_t index) const { in ElementForIndex() argument
318 DCHECK_LT(index, NumBuckets()); in ElementForIndex()
320 return data_[index]; in ElementForIndex()
325 size_t NextIndex(size_t index) const { in NextIndex() argument
326 if (UNLIKELY(++index >= num_buckets_)) { in NextIndex()
327 DCHECK_EQ(index, NumBuckets()); in NextIndex()
330 return index; in NextIndex()
332 bool IsFreeSlot(size_t index) const { in IsFreeSlot() argument
333 return emptyfn_.IsEmpty(ElementForIndex(index)); in IsFreeSlot()
384 ALWAYS_INLINE size_t FirstAvailableSlot(size_t index) const { in FirstAvailableSlot() argument
385 while (!emptyfn_.IsEmpty(data_[index])) { in FirstAvailableSlot()
386 index = NextIndex(index); in FirstAvailableSlot()
388 return index; in FirstAvailableSlot()