MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / indexSplit

Method indexSplit

source/core/StarBTreeDatabase.cpp:571–579  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

569}
570
571auto BTreeDatabase::BTreeImpl::indexSplit(Index const& index) -> Maybe<pair<Key, Index>> {
572 if (index->pointerCount() <= parent->maxIndexPointers())
573 return {};
574
575 auto right = make_shared<IndexNode>();
576 right->self = InvalidBlockIndex;
577 Key k = index->split(*right, (index->pointerCount() + 1) / 2);
578 return make_pair(k, right);
579}
580
581auto BTreeDatabase::BTreeImpl::storeIndex(Index index) -> Pointer {
582 if (index->self != InvalidBlockIndex) {

Callers

nothing calls this directly

Calls 3

maxIndexPointersMethod · 0.80
pointerCountMethod · 0.45
splitMethod · 0.45

Tested by

no test coverage detected