MCPcopy Create free account
hub / github.com/SergeyMakeev/ExcaliburHash / reinsert

Function reinsert

ExcaliburHash/ExcaliburHash.h:689–715  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

687 }
688
689 inline void reinsert(size_t numBucketsNew, TItem* EXLBR_RESTRICT item, TItem* const enditem) noexcept
690 {
691 // re-insert existing elements
692 for (; item != enditem; item++)
693 {
694 if (item->isValid())
695 {
696 if constexpr (has_values::value)
697 {
698 emplaceToExisting(numBucketsNew, std::move(*item->key()), std::move(*item->value()));
699 }
700 else
701 {
702 emplaceToExisting(numBucketsNew, std::move(*item->key()));
703 }
704
705 // destroy old value if need
706 if constexpr ((!std::is_trivially_destructible<TValue>::value) && (has_values::value))
707 {
708 destruct(item->value());
709 }
710 }
711
712 // note: this won't automatically call value dtors!
713 destruct(item);
714 }
715 }
716
717 template <typename TK, class... Args>
718 inline std::pair<IteratorKV, bool> emplaceReallocate(uint32_t numBucketsNew, TK&& key, Args&&... args)

Callers 2

emplaceReallocateFunction · 0.85
ExcaliburHash.hFile · 0.85

Calls 3

valueMethod · 0.80
isValidMethod · 0.45
keyMethod · 0.45

Tested by

no test coverage detected