forked from qt-creator/qt-creator
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>
This commit is contained in:
@@ -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(),
|
||||
|
||||
Reference in New Issue
Block a user