MCPcopy Create free account
hub / github.com/KentBeck/BPlusTree3 / collect_leaf_ids

Method collect_leaf_ids

rust/src/validation.rs:136–147  ·  view source on GitHub ↗

Collect all leaf node IDs from the tree structure.

(&self, node: &NodeRef<K, V>, ids: &mut Vec<NodeId>)

Source from the content-addressed store, hash-verified

134
135 /// Collect all leaf node IDs from the tree structure.
136 fn collect_leaf_ids(&self, node: &NodeRef<K, V>, ids: &mut Vec<NodeId>) {
137 match node {
138 NodeRef::Leaf(id, _) => ids.push(*id),
139 NodeRef::Branch(id, _) => {
140 if let Some(branch) = self.get_branch(*id) {
141 for child in &branch.children {
142 self.collect_leaf_ids(child, ids);
143 }
144 }
145 }
146 }
147 }
148
149 /// Recursively check invariants for a node and its children.
150 fn check_node_invariants(

Calls 1

get_branchMethod · 0.80

Tested by

no test coverage detected