MCPcopy Create free account
hub / github.com/KDE/kdevelop / createSetFromNodes

Method createSetFromNodes

kdevplatform/language/util/setrepository.cpp:530–550  ·  view source on GitHub ↗

Creates a set item with the given children., they must be valid, and they must be split around their split-position.

Source from the content-addressed store, hash-verified

528
529//Creates a set item with the given children., they must be valid, and they must be split around their split-position.
530uint SetRepositoryAlgorithms::createSetFromNodes(uint leftNode, uint rightNode, const SetNodeData* left,
531 const SetNodeData* right)
532{
533 if (!left)
534 left = nodeFromIndex(leftNode);
535 if (!right)
536 right = nodeFromIndex(rightNode);
537
538 Q_ASSERT(left->end() <= right->start());
539
540 SetNodeData set(left->start(), right->end(), leftNode, rightNode);
541
542 Q_ASSERT(set.start() < set.end());
543
544 uint ret = repository.index(SetNodeDataRequest(&set, repository, setRepository));
545 Q_ASSERT(set.leftNode() >= 0x10000);
546 Q_ASSERT(set.rightNode() >= 0x10000);
547 Q_ASSERT(ret == repository.findIndex(SetNodeDataRequest(&set, repository, setRepository)));
548 ifDebug(check(ret));
549 return ret;
550}
551
552//Constructs a set node from the given two sub-nodes. Those must be valid, they must not intersect, and they must have a correct split-hierarchy.
553//The do not need to be split around their computed split-position.

Callers

nothing calls this directly

Calls 6

nodeFromIndexFunction · 0.85
SetNodeDataRequestClass · 0.70
endMethod · 0.45
startMethod · 0.45
indexMethod · 0.45
findIndexMethod · 0.45

Tested by

no test coverage detected