Defer child[1] of a node we're descending past. */
| 183 | |
| 184 | /* Defer child[1] of a node we're descending past. */ |
| 185 | static 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. */ |
| 203 | static const char *iter_descend(struct strmap_iter *it, struct strmap *slot, |