void go_to_next_leaf()

in include/PatriciaTreeMap.h [1225:1241]


  void go_to_next_leaf(
      const boost::intrusive_ptr<PatriciaTree<IntegerType, Value>>& tree) {
    auto t = tree;
    // We go to the leftmost leaf, storing the branches that we're traversing
    // on the stack. By definition of a Patricia tree, a branch node always
    // has two children, hence the leftmost leaf always exists.
    while (t->is_branch()) {
      auto branch =
          boost::static_pointer_cast<PatriciaTreeBranch<IntegerType, Value>>(t);
      m_stack.push(branch);
      t = branch->left_tree();
      // A branch node always has two children.
      RUNTIME_CHECK(t != nullptr, internal_error());
    }
    m_leaf =
        boost::static_pointer_cast<PatriciaTreeLeaf<IntegerType, Value>>(t);
  }