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

Function htable_val

ccan/ccan/htable/htable.c:147–161  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

145}
146
147static void *htable_val(const struct htable *ht,
148 struct htable_iter *i, size_t hash, uintptr_t perfect)
149{
150 uintptr_t h2 = get_hash_ptr_bits(ht, hash) | perfect;
151
152 while (ht->table[i->off]) {
153 if (ht->table[i->off] != HTABLE_DELETED) {
154 if (get_extra_ptr_bits(ht, ht->table[i->off]) == h2)
155 return get_raw_ptr(ht, ht->table[i->off]);
156 }
157 i->off = (i->off + 1) & ((1 << ht->bits)-1);
158 h2 &= ~perfect;
159 }
160 return NULL;
161}
162
163void *htable_firstval_(const struct htable *ht,
164 struct htable_iter *i, size_t hash)

Callers 2

htable_firstval_Function · 0.85
htable_nextval_Function · 0.85

Calls 3

get_hash_ptr_bitsFunction · 0.85
get_extra_ptr_bitsFunction · 0.85
get_raw_ptrFunction · 0.85

Tested by

no test coverage detected