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

Method _insert_into_branch

python/bplustree/bplus_tree.py:199–209  ·  view source on GitHub ↗

Insert a separator and new child into a branch node. Returns None or (new_branch, separator) if split.

(
        self,
        branch: "BranchNode",
        child_index: int,
        separator_key: Any,
        new_child: "Node",
    )

Source from the content-addressed store, hash-verified

197 return leaf.split_and_insert(key, value)
198
199 def _insert_into_branch(
200 self,
201 branch: "BranchNode",
202 child_index: int,
203 separator_key: Any,
204 new_child: "Node",
205 ) -> Optional[Tuple["BranchNode", Any]]:
206 """Insert a separator and new child into a branch node. Returns None or (new_branch, separator) if split."""
207 return branch.insert_child_and_split_if_needed(
208 child_index, separator_key, new_child
209 )
210
211 def __getitem__(self, key: Any) -> Any:
212 """Get value for a key (dict-like API)"""

Callers 1

_insert_recursiveMethod · 0.95

Tested by

no test coverage detected