Condense root: if root is internal with 1 child, collapse.
(&mut self)
| 109 | |
| 110 | /// Condense root: if root is internal with 1 child, collapse. |
| 111 | pub(crate) fn condense_root(&mut self) { |
| 112 | if let NodeKind::Internal { children } = &self.nodes[self.root].kind |
| 113 | && children.len() == 1 |
| 114 | { |
| 115 | self.root = children[0].node_idx; |
| 116 | } |
| 117 | } |
| 118 | } |
| 119 | |
| 120 | impl Default for RTree { |