Return a pointer to slot that points to a cache entry that matches key/hash. If there is no such cache entry, return a pointer to the trailing slot in the corresponding linked list.
| 157 | // matches key/hash. If there is no such cache entry, return a |
| 158 | // pointer to the trailing slot in the corresponding linked list. |
| 159 | RLHandle** FindPointer(const Slice& key, uint32_t hash) { |
| 160 | RLHandle** ptr = &list_[hash & (length_ - 1)]; |
| 161 | while (*ptr != nullptr && |
| 162 | ((*ptr)->hash != hash || key != (*ptr)->key())) { |
| 163 | ptr = &(*ptr)->next_hash; |
| 164 | } |
| 165 | return ptr; |
| 166 | } |
| 167 | |
| 168 | void Resize() { |
| 169 | uint32_t new_length = 16; |