Move the path to the last entry of the previous leaf node, if one exists. Returns the new leaf node if it exists. Leave the path unchanged and returns `None` if we are already at the first leaf node.
(&mut self, pool: &NodePool<F>)
| 193 | /// |
| 194 | /// Leave the path unchanged and returns `None` if we are already at the first leaf node. |
| 195 | fn prev_leaf(&mut self, pool: &NodePool<F>) -> Option<Node> { |
| 196 | self.left_sibling_branch_level(self.size - 1).map(|bl| { |
| 197 | let entry = self.entry[bl] - 1; |
| 198 | self.entry[bl] = entry; |
| 199 | let (_, bnodes) = pool[self.node[bl]].unwrap_inner(); |
| 200 | self.goto_subtree_last(bl + 1, bnodes[usize::from(entry)], pool) |
| 201 | }) |
| 202 | } |
| 203 | |
| 204 | /// Move this path to the last position for the sub-tree at `level, root`. |
| 205 | fn goto_subtree_last(&mut self, level: usize, root: Node, pool: &NodePool<F>) -> Node { |
no test coverage detected