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

Method find_child_index

rust/src/node.rs:621–627  ·  view source on GitHub ↗
(&self, key: &K)

Source from the content-addressed store, hash-verified

619 /// Find the index of the child that should contain the given key.
620 #[inline]
621 pub fn find_child_index(&self, key: &K) -> usize {
622 // Binary search to find the appropriate child
623 match self.keys.binary_search(key) {
624 Ok(index) => index + 1, // Key found, go to right child
625 Err(index) => index, // Key not found, index is the insertion point
626 }
627 }
628
629 /// Returns the number of keys in this branch node.
630 pub fn len(&self) -> usize {

Callers 7

get_child_for_keyMethod · 0.45
find_leaf_for_keyMethod · 0.45
find_childMethod · 0.45
find_child_mutMethod · 0.45
get_childMethod · 0.45
get_child_mutMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected