MCPcopy Create free account
hub / github.com/NetSys/bess / RemoveFromBucket

Method RemoveFromBucket

core/utils/cuckoo_map.h:353–370  ·  view source on GitHub ↗

Remove key from the bucket indexed by bucket_idx Return true if success.

Source from the content-addressed store, hash-verified

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.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected