Splits the SkipLists so that those after finger is moved to "right".
| 761 | |
| 762 | // Splits the SkipLists so that those after finger is moved to "right". |
| 763 | void split(const Finger& f, SkipList& right) { |
| 764 | ASSERT(!right.header->getNext(0)); // right must be empty |
| 765 | right.header->setMaxVersion(0, f.finger[0]->getMaxVersion(0)); |
| 766 | for (int l = 0; l < MaxLevels; l++) { |
| 767 | right.header->setNext(l, f.finger[l]->getNext(l)); |
| 768 | f.finger[l]->setNext(l, nullptr); |
| 769 | } |
| 770 | } |
| 771 | |
| 772 | // Sets end's finger to the last nodes at all levels. |
| 773 | void getEnd(Finger& end) { |