* Split this node. * Modifies this to remove the second half of the items, returning a separate node containing them.
()
| 850 | * Modifies this to remove the second half of the items, returning a separate node containing them. |
| 851 | */ |
| 852 | splitOffRightSide() { |
| 853 | // assert !this.isShared; |
| 854 | const half = this.children.length >> 1 |
| 855 | return new BNodeInternal<K, V>( |
| 856 | this.children.splice(half), |
| 857 | this.keys.splice(half), |
| 858 | ) |
| 859 | } |
| 860 | |
| 861 | takeFromRight(rhs: BNode<K, V>) { |
| 862 | // Reminder: parent node must update its copy of key for this node |