Defer child[1] of a node we're descending past. */
| 245 | |
| 246 | /* Defer child[1] of a node we're descending past. */ |
| 247 | static 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. */ |
| 265 | static const char *iter_descend(struct strset_iter *it, struct strset *slot) |