| 552 | } |
| 553 | |
| 554 | bool BTreeDatabase::BTreeImpl::indexShift(Index const& left, Key const& mid, Index const& right) { |
| 555 | if (left->pointerCount() + right->pointerCount() <= parent->maxIndexPointers()) { |
| 556 | left->shiftLeft(mid, *right, right->pointerCount()); |
| 557 | return true; |
| 558 | } else { |
| 559 | if (indexNeedsShift(right)) { |
| 560 | right->shiftRight(mid, *left, 1); |
| 561 | return true; |
| 562 | } else if (indexNeedsShift(left)) { |
| 563 | left->shiftLeft(mid, *right, 1); |
| 564 | return true; |
| 565 | } else { |
| 566 | return false; |
| 567 | } |
| 568 | } |
| 569 | } |
| 570 | |
| 571 | auto BTreeDatabase::BTreeImpl::indexSplit(Index const& index) -> Maybe<pair<Key, Index>> { |
| 572 | if (index->pointerCount() <= parent->maxIndexPointers()) |
nothing calls this directly
no test coverage detected