MCPcopy Create free account
hub / github.com/ElementsProject/lightning / htable_delval_

Function htable_delval_

ccan/ccan/htable/htable.c:415–427  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

413}
414
415void htable_delval_(struct htable *ht, struct htable_iter *i)
416{
417 assert(i->off < (size_t)1 << ht->bits);
418 assert(entry_is_valid(ht->table[i->off]));
419
420 ht->elems--;
421 /* Cheap test: if the next bucket is empty, don't need delete marker */
422 if (ht->table[hash_bucket(ht, i->off+1)] != 0) {
423 ht->table[i->off] = HTABLE_DELETED;
424 ht->deleted++;
425 } else
426 ht->table[i->off] = 0;
427}
428
429void *htable_pick_(const struct htable *ht, size_t seed, struct htable_iter *i)
430{

Callers

nothing calls this directly

Calls 2

entry_is_validFunction · 0.85
hash_bucketFunction · 0.85

Tested by

no test coverage detected