summaryrefslogtreecommitdiff
path: root/src/plugins/projectexplorer/project.cpp
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@qt.io>2021-07-13 16:58:02 +0200
committerEike Ziller <eike.ziller@qt.io>2021-07-14 13:43:23 +0000
commit426f8185c2bc707238f5ee316262e96db63d3853 (patch)
tree5c640768438262652923607eead2e665ab4ba354 /src/plugins/projectexplorer/project.cpp
parent098e616512d6b171a382ed1990b7125b4bdfce3d (diff)
downloadqt-creator-426f8185c2bc707238f5ee316262e96db63d3853.tar.gz
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 <christian.kandeler@qt.io>
Diffstat (limited to 'src/plugins/projectexplorer/project.cpp')
-rw-r--r--src/plugins/projectexplorer/project.cpp2
1 files changed, 1 insertions, 1 deletions
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(),