Skip to content

Commit effb56b

Browse files
committed
Step 3: Move allocate_branch method to insert_operations
- Move allocate_branch method from lib.rs to insert_operations.rs - Remove original method from lib.rs - All tests still pass (35/35) - Continuing incremental extraction
1 parent 95b5e2d commit effb56b

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

rust/src/insert_operations.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ impl<K: Ord + Clone, V: Clone> BPlusTreeMap<K, V> {
1313
pub fn allocate_leaf(&mut self, leaf: LeafNode<K, V>) -> NodeId {
1414
self.leaf_arena.allocate(leaf)
1515
}
16+
17+
/// Allocate a new branch node in the arena and return its ID.
18+
pub fn allocate_branch(&mut self, branch: BranchNode<K, V>) -> NodeId {
19+
self.branch_arena.allocate(branch)
20+
}
1621
}
1722

1823
#[cfg(test)]

rust/src/lib.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1475,10 +1475,7 @@ impl<K: Ord + Clone, V: Clone> BPlusTreeMap<K, V> {
14751475
// ENHANCED ARENA-BASED ALLOCATION FOR BRANCH NODES
14761476
// ============================================================================
14771477

1478-
/// Allocate a new branch node in the arena and return its ID.
1479-
pub fn allocate_branch(&mut self, branch: BranchNode<K, V>) -> NodeId {
1480-
self.branch_arena.allocate(branch)
1481-
}
1478+
// allocate_branch method moved to insert_operations.rs module
14821479

14831480
/// Deallocate a branch node from the arena.
14841481
pub fn deallocate_branch(&mut self, id: NodeId) -> Option<BranchNode<K, V>> {

0 commit comments

Comments
 (0)