Creates a set item with the given children., they must be valid, and they must be split around their split-position.
| 528 | |
| 529 | //Creates a set item with the given children., they must be valid, and they must be split around their split-position. |
| 530 | uint 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. |
nothing calls this directly
no test coverage detected