| 346 | } |
| 347 | |
| 348 | Maybe<Leaf> leafSplit(Leaf& leaf) { |
| 349 | if (leaf.count() <= maxLeafSize) { |
| 350 | return {}; |
| 351 | } else { |
| 352 | Leaf right; |
| 353 | right.self = -1; |
| 354 | |
| 355 | leaf.split(right, (leaf.count() + 1) / 2); |
| 356 | |
| 357 | return right; |
| 358 | } |
| 359 | } |
| 360 | |
| 361 | Pointer storeLeaf(Leaf leaf) { |
| 362 | if (leaf.self != -1) |