Descend from 'parent' into child 'childidx', updating the iterator key. * If the child is inline we stop on the virtual leaf without changing the * tree. Otherwise we enter the real child node as usual. */
| 1576 | * If the child is inline we stop on the virtual leaf without changing the |
| 1577 | * tree. Otherwise we enter the real child node as usual. */ |
| 1578 | static inline int raxIteratorEnterChild(raxIterator *it, raxNode *parent, |
| 1579 | raxNode **childfield, int childidx) |
| 1580 | { |
| 1581 | if (parent->iscompr) { |
| 1582 | if (!raxIteratorAddChars(it,parent->data,parent->size)) return 0; |
| 1583 | } else { |
| 1584 | if (!raxIteratorAddChars(it,parent->data+childidx,1)) return 0; |
| 1585 | } |
| 1586 | |
| 1587 | if (raxIsInlineLeaf(parent,childidx)) |
| 1588 | return raxIteratorSetInlineLeaf(it,parent,childfield,childidx); |
| 1589 | |
| 1590 | if (!raxStackPush(&it->stack,parent)) return 0; |
| 1591 | memcpy(&it->node,childfield,sizeof(it->node)); |
| 1592 | it->node_child = childidx; |
| 1593 | if (it->node_cb && it->node_cb(&it->node)) |
| 1594 | memcpy(childfield,&it->node,sizeof(it->node)); |
| 1595 | it->data = it->node->iskey ? raxGetData(it->node) : NULL; |
| 1596 | return 1; |
| 1597 | } |
| 1598 | |
| 1599 | /* Return the pointer-to-pointer in the tree that references the element |
| 1600 | * currently selected by the iterator. For regular key nodes this is the |
no test coverage detected