| 329 | } |
| 330 | |
| 331 | bool leafShift(Leaf& left, Leaf& right) { |
| 332 | if (left.count() + right.count() <= maxLeafSize) { |
| 333 | left.shiftLeft(right, right.count()); |
| 334 | return true; |
| 335 | } else { |
| 336 | if (leafNeedsShift(right)) { |
| 337 | right.shiftRight(left, 1); |
| 338 | return true; |
| 339 | } else if (leafNeedsShift(left)) { |
| 340 | left.shiftLeft(right, 1); |
| 341 | return true; |
| 342 | } else { |
| 343 | return false; |
| 344 | } |
| 345 | } |
| 346 | } |
| 347 | |
| 348 | Maybe<Leaf> leafSplit(Leaf& leaf) { |
| 349 | if (leaf.count() <= maxLeafSize) { |
nothing calls this directly
no test coverage detected