Moves the iterator to the next node in the tree. If we are at the end, do nothing, otherwise if our current node has children, use the children iterator and push the current node into the stack. If we reach the end of the local iterator, pop it.
| 223 | // current node into the stack. |
| 224 | // If we reach the end of the local iterator, pop it. |
| 225 | inline void WalkToLeaf() { |
| 226 | while (current_->begin() != current_->end()) { |
| 227 | NodeIterator next = ++current_->begin(); |
| 228 | parent_iterators_.emplace(make_pair(current_, next)); |
| 229 | // Set the first child as the new node. |
| 230 | current_ = *current_->begin(); |
| 231 | } |
| 232 | } |
| 233 | |
| 234 | // The current node of the tree. |
| 235 | NodePtr current_; |