MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / condense_root

Method condense_root

nodedb-spatial/src/rtree/tree.rs:111–117  ·  view source on GitHub ↗

Condense root: if root is internal with 1 child, collapse.

(&mut self)

Source from the content-addressed store, hash-verified

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
120impl Default for RTree {

Callers 1

deleteMethod · 0.80

Calls 1

lenMethod · 0.45

Tested by

no test coverage detected