MCPcopy Create free account
hub / github.com/CodingGay/BlackDex / InsertWithHash

Method InsertWithHash

Bcore/src/main/cpp/base/hash_set.h:397–406  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

395
396 template <typename U, typename = typename std::enable_if<std::is_convertible<U, T>::value>::type>
397 void InsertWithHash(U&& element, size_t hash) {
398 DCHECK_EQ(hash, hashfn_(element));
399 if (num_elements_ >= elements_until_expand_) {
400 Expand();
401 DCHECK_LT(num_elements_, elements_until_expand_);
402 }
403 const size_t index = FirstAvailableSlot(IndexForHash(hash));
404 data_[index] = std::forward<U>(element);
405 ++num_elements_;
406 }
407
408 size_t Size() const {
409 return num_elements_;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected