Home | History | Annotate | Download | only in base

Lines Matching refs:element

358   // If an element in between doesn't rehash to the range from the current empty slot to the
362 // element to its actual location/index.
363 // Note that since erase shuffles back elements, it may result in the same element being visited
364 // twice during HashSet iteration. This happens when an element already visited during iteration
375 // If the next element is empty, we are done. Make sure to clear the current empty index.
380 // Otherwise try to see if the next element can fill the current empty index.
412 // Find an element, returns end() if not found.
436 // Insert an element with hint, allows duplicates.
439 iterator insert(const_iterator hint ATTRIBUTE_UNUSED, const T& element) {
440 return insert(element);
442 iterator insert(const_iterator hint ATTRIBUTE_UNUSED, T&& element) {
443 return insert(std::move(element));
446 // Insert an element, allows duplicates.
447 iterator insert(const T& element) {
448 return InsertWithHash(element, hashfn_(element));
450 iterator insert(T&& element) {
451 return InsertWithHash(std::move(element), hashfn_(element));
455 iterator InsertWithHash(U&& element, size_t hash) {
456 DCHECK_EQ(hash, hashfn_(element));
462 data_[index] = std::forward<U>(element);
509 const T& element = ElementForIndex(i);
510 if (!emptyfn_.IsEmpty(element)) {
511 size_t ideal_location = IndexForHash(hashfn_(element));
531 T& element = data_[i];
532 if (!emptyfn_.IsEmpty(element)) {
535 std::swap(temp, element);
538 LOG(ERROR) << "Element " << i << " should be in slot " << first_slot;
541 std::swap(temp, element);
610 // Find the hash table slot for an element, or return NumBuckets() if not found.
613 size_t FindIndex(const K& element, size_t hash) const {
614 // Guard against failing to get an element for a non-existing index.
618 DCHECK_EQ(hashfn_(element), hash);
625 if (pred_(slot, element)) {
680 T& element = old_data[i];
681 if (!emptyfn_.IsEmpty(element)) {
682 data_[FirstAvailableSlot(IndexForHash(hashfn_(element)))] = std::move(element);
685 allocfn_.destroy(allocfn_.address(element));