forked from qt-creator/qt-creator
CMake: TeaLeafReader: Simplify code
Change-Id: Ib615fde89952848c4cfe392a2e84c15f6b73de80 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
@@ -360,18 +360,12 @@ void TeaLeafReader::generateProjectTree(CMakeListsNode *root, const QList<FileNo
|
|||||||
}
|
}
|
||||||
const QList<FileName> allIncludePaths = allIncludePathSet.toList();
|
const QList<FileName> allIncludePaths = allIncludePathSet.toList();
|
||||||
|
|
||||||
QList<FileNode *> includedHeaderFiles;
|
const QList<FileNode *> includedHeaderFiles
|
||||||
QList<FileNode *> unusedFileNodes;
|
= Utils::filtered(allFiles, [&allIncludePaths](const FileNode *fn) -> bool {
|
||||||
std::tie(includedHeaderFiles, unusedFileNodes)
|
|
||||||
= Utils::partition(allFiles, [&allIncludePaths](const FileNode *fn) -> bool {
|
|
||||||
if (fn->fileType() != FileType::Header)
|
if (fn->fileType() != FileType::Header)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
for (const FileName &inc : allIncludePaths) {
|
return Utils::contains(allIncludePaths, [fn](const FileName &inc) { return fn->filePath().isChildOf(inc); });
|
||||||
if (fn->filePath().isChildOf(inc))
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const auto knownFiles = QSet<FileName>::fromList(Utils::transform(m_files, [](const FileNode *fn) { return fn->filePath(); }));
|
const auto knownFiles = QSet<FileName>::fromList(Utils::transform(m_files, [](const FileNode *fn) { return fn->filePath(); }));
|
||||||
|
Reference in New Issue
Block a user