forked from qt-creator/qt-creator
AutoTest: Speed up finding parent items
We normally add new results to the last added item, so processing the search for the parent from bottom to top makes more sense and avoids iterating over almost every item. Change-Id: Iede08b9c0d4c80227d2e8fea9b002354f01d5b35 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -313,7 +313,7 @@ TestResultItem *TestResultModel::findParentItemFor(const TestResultItem *item,
|
||||
TestResultItem *currentItem = static_cast<TestResultItem *>(it);
|
||||
return currentItem->testResult()->isDirectParentOf(result, &needsIntermediate);
|
||||
};
|
||||
TestResultItem *parent = static_cast<TestResultItem *>(root->findAnyChild(predicate));
|
||||
TestResultItem *parent = static_cast<TestResultItem *>(root->reverseFindAnyChild(predicate));
|
||||
if (parent) {
|
||||
if (needsIntermediate) {
|
||||
// check if the intermediate is present already
|
||||
|
||||
Reference in New Issue
Block a user