CMake: Avoid a bit of useless processing when updating the project tree

Do not pass around a list of filenodes with all the known header files.
That list gets converted into a QSet<FilePath> and then that is used.

Just generate the QSet<FilePath> directly and avoid that conversion.

Change-Id: I2444a2a6b4a1600fe476e66673a1a2e9c8900764
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Tobias Hunger
2019-06-20 15:51:04 +02:00
parent 129c0abb5a
commit add60c0148
7 changed files with 27 additions and 31 deletions

View File

@@ -174,7 +174,7 @@ CMakeTargetNode *createTargetNode(const QHash<Utils::FilePath, ProjectNode *> &c
}
void addHeaderNodes(ProjectNode *root,
const QVector<FileNode *> knownHeaders,
QSet<Utils::FilePath> &seenHeaders,
const QList<const FileNode *> &allFiles)
{
if (root->isEmpty())
@@ -188,9 +188,6 @@ void addHeaderNodes(ProjectNode *root,
QCoreApplication::translate("CMakeProjectManager::Internal::ServerModeReader", "<Headers>"));
headerNode->setIcon(headerNodeIcon);
// knownHeaders are already listed in their targets:
QSet<Utils::FilePath> seenHeaders = Utils::transform<QSet>(knownHeaders, &FileNode::filePath);
// Add scanned headers:
for (const FileNode *fn : allFiles) {
if (fn->fileType() != FileType::Header || !fn->filePath().isChildOf(root->filePath()))