ProjectExplorer: Simplify

bugprone-branch-clone
readability-simplify-boolean-expr

Change-Id: Iaaac21e96a3e9db6b9819d77fdae623ede373e59
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
Nikolai Kosjar
2019-10-31 16:29:42 +01:00
parent c81e9a2406
commit 6c1b11dd3e
7 changed files with 5 additions and 20 deletions

View File

@@ -376,10 +376,7 @@ Node *ProjectTreeWidget::nodeForFile(const FilePath &fileName)
if (ProjectNode *projectNode = project->rootProjectNode()) {
projectNode->forEachGenericNode([&](Node *node) {
if (node->filePath() == fileName) {
if (!bestNode) {
bestNode = node;
bestNodeExpandCount = ProjectTreeWidget::expandedCount(node);
} else if (priority(node) < priority(bestNode)) {
if (!bestNode || priority(node) < priority(bestNode)) {
bestNode = node;
bestNodeExpandCount = ProjectTreeWidget::expandedCount(node);
} else if (priority(node) == priority(bestNode)) {