(maxKeys int, isLeaf bool)
| 22 | } |
| 23 | |
| 24 | func NewBTreeNode[T constraints.Ordered](maxKeys int, isLeaf bool) *BTreeNode[T] { |
| 25 | if maxKeys <= 0 { |
| 26 | panic("BTree maxKeys cannot be zero") |
| 27 | } |
| 28 | return &BTreeNode[T]{ |
| 29 | keys: make([]T, maxKeys), |
| 30 | children: make([]*BTreeNode[T], maxKeys+1), |
| 31 | isLeaf: isLeaf, |
| 32 | } |
| 33 | } |
| 34 | |
| 35 | func NewBTree[T constraints.Ordered](maxKeys int) *BTree[T] { |
| 36 | if maxKeys <= 2 { |
nothing calls this directly
no outgoing calls
no test coverage detected