Lines Matching refs:hash
53 // Low memory version of a hash set, uses less memory than std::unordered_set since elements aren't
58 template <class T, class EmptyFn = DefaultEmptyFn<T>, class HashFn = std::hash<T>,
312 Iterator FindWithHash(const K& element, size_t hash) {
313 return Iterator(this, FindIndex(element, hash));
317 ConstIterator FindWithHash(const K& element, size_t hash) const {
318 return ConstIterator(this, FindIndex(element, hash));
326 void InsertWithHash(const T& element, size_t hash) {
327 DCHECK_EQ(hash, hashfn_(element));
332 const size_t index = FirstAvailableSlot(IndexForHash(hash));
345 // To distance that inserted elements were probed. Used for measuring how good hash functions
401 size_t IndexForHash(size_t hash) const {
402 return hash % num_buckets_;
413 // Find the hash table slot for an element, or return NumBuckets() if not found.
416 size_t FindIndex(const K& element, size_t hash) const {
417 DCHECK_EQ(hashfn_(element), hash);
418 size_t index = IndexForHash(hash);
528 size_t num_buckets_; // Number of hash table buckets.