From 426f8185c2bc707238f5ee316262e96db63d3853 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Tue, 13 Jul 2021 16:58:02 +0200 Subject: ProjectTree: Improve performance of finding nodes Using projectNode->forEachGenericNode(...) to find a node is much slower than using project->nodeForFilePath(...), since the latter uses a binary search. Fixes: QTCREATORBUG-25845 Change-Id: I91be577a11b03915d1f21fe86a4cdd9ab0381f51 Reviewed-by: Christian Kandeler --- src/plugins/projectexplorer/project.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/plugins/projectexplorer/project.cpp') diff --git a/src/plugins/projectexplorer/project.cpp b/src/plugins/projectexplorer/project.cpp index 7064e47204..25fe115afd 100644 --- a/src/plugins/projectexplorer/project.cpp +++ b/src/plugins/projectexplorer/project.cpp @@ -851,7 +851,7 @@ bool Project::isKnownFile(const Utils::FilePath &filename) const } const Node *Project::nodeForFilePath(const Utils::FilePath &filePath, - const Project::NodeMatcher &extraMatcher) + const Project::NodeMatcher &extraMatcher) const { const FileNode dummy(filePath, FileType::Unknown); const auto range = std::equal_range(d->m_sortedNodeList.cbegin(), d->m_sortedNodeList.cend(), -- cgit v1.2.1