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

Function iter_push

ccan/ccan/strmap/strmap.c:185–200  ·  view source on GitHub ↗

Defer child[1] of a node we're descending past. */

Source from the content-addressed store, hash-verified

183
184/* Defer child[1] of a node we're descending past. */
185static void iter_push(struct strmap_iter *it, struct strmap *slot)
186{
187 if (STRMAP_NUM_ITER_PARENTS == 0) {
188 it->dropped = true;
189 return;
190 }
191 if (it->num_parents == STRMAP_NUM_ITER_PARENTS) {
192 /* Full: drop the *shallowest* deferral (kept in-order by
193 * the slow path once the stack runs out). */
194 memmove(&it->parents[0], &it->parents[1],
195 sizeof(it->parents[0]) * (STRMAP_NUM_ITER_PARENTS - 1));
196 it->num_parents--;
197 it->dropped = true;
198 }
199 it->parents[it->num_parents++] = slot;
200}
201
202/* Descend leftmost from *slot, deferring child[1]s, and yield the leaf. */
203static const char *iter_descend(struct strmap_iter *it, struct strmap *slot,

Callers 1

iter_descendFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected