Return the slot index in the bucket that matches the primary hash_value and the actual key. Return -1 if not found.
| 430 | // Return the slot index in the bucket that matches the primary hash_value |
| 431 | // and the actual key. Return -1 if not found. |
| 432 | int FindSlot(const Bucket& bucket, HashResult primary, const K& key, |
| 433 | const E& eq) const { |
| 434 | for (int i = 0; i < kEntriesPerBucket; i++) { |
| 435 | if (bucket.hash_values[i] == primary) { |
| 436 | EntryIndex idx = bucket.entry_indices[i]; |
| 437 | const Entry& entry = entries_[idx]; |
| 438 | |
| 439 | if (likely(Eq(entry.first, key, eq))) { |
| 440 | return i; |
| 441 | } |
| 442 | } |
| 443 | } |
| 444 | return -1; |
| 445 | } |
| 446 | |
| 447 | // Recursively try making an empty slot in the bucket |
| 448 | // Returns a slot index in [0, kEntriesPerBucket) for successful operation, |
nothing calls this directly
no outgoing calls
no test coverage detected