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

Method delete

python/bplustree/bplus_tree.py:770–776  ·  view source on GitHub ↗

Delete a key, returns the value if found

(self, key: Any)

Source from the content-addressed store, hash-verified

768 return None
769
770 def delete(self, key: Any) -> Optional[Any]:
771 """Delete a key, returns the value if found"""
772 pos, exists = self.find_position(key)
773 if exists:
774 self.keys.pop(pos)
775 return self.values.pop(pos)
776 return None
777
778 def split(self) -> "LeafNode":
779 """Split this leaf node, returning the new right node"""

Callers 1

_delete_from_leafMethod · 0.80

Calls 2

find_positionMethod · 0.95
popMethod · 0.45

Tested by

no test coverage detected