Remove key from the bucket indexed by bucket_idx Return true if success.
| 351 | // Remove key from the bucket indexed by bucket_idx |
| 352 | // Return true if success. |
| 353 | bool RemoveFromBucket(HashResult primary, HashResult bucket_idx, const K& key, |
| 354 | const E& eq) { |
| 355 | Bucket& bucket = buckets_[bucket_idx]; |
| 356 | |
| 357 | int slot_idx = FindSlot(bucket, primary, key, eq); |
| 358 | if (slot_idx == -1) { |
| 359 | return false; |
| 360 | } |
| 361 | |
| 362 | bucket.hash_values[slot_idx] = 0; |
| 363 | |
| 364 | EntryIndex idx = bucket.entry_indices[slot_idx]; |
| 365 | entries_[idx] = Entry(); |
| 366 | PushFreeEntryIndex(idx); |
| 367 | |
| 368 | num_entries_--; |
| 369 | return true; |
| 370 | } |
| 371 | |
| 372 | // Find key from the bucket indexed by bucket_idx |
| 373 | // Return the index of the entry if success. Otherwise return nullptr. |
nothing calls this directly
no outgoing calls
no test coverage detected