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

Function iter_push

ccan/ccan/strset/strset.c:247–262  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

245
246/* Defer child[1] of a node we're descending past. */
247static void iter_push(struct strset_iter *it, struct strset *slot)
248{
249 if (STRSET_NUM_ITER_PARENTS == 0) {
250 it->dropped = true;
251 return;
252 }
253 if (it->num_parents == STRSET_NUM_ITER_PARENTS) {
254 /* Full: drop the *shallowest* deferral (kept in-order by
255 * the slow_mode path once the stack runs out). */
256 memmove(&it->parents[0], &it->parents[1],
257 sizeof(it->parents[0]) * (STRSET_NUM_ITER_PARENTS - 1));
258 it->num_parents--;
259 it->dropped = true;
260 }
261 it->parents[it->num_parents++] = slot;
262}
263
264/* Descend leftmost from *slot, deferring child[1]s, and yield the leaf. */
265static const char *iter_descend(struct strset_iter *it, struct strset *slot)

Callers 1

iter_descendFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected