Commit e37539a1 authored by Tobias Hunger's avatar Tobias Hunger

CMake: TeaLeafReader: Simplify code

Change-Id: Ib615fde89952848c4cfe392a2e84c15f6b73de80
Reviewed-by: Tim Jenssen's avatarTim Jenssen <tim.jenssen@qt.io>
parent ff68d4ca
......@@ -360,18 +360,12 @@ void TeaLeafReader::generateProjectTree(CMakeListsNode *root, const QList<FileNo
}
const QList<FileName> allIncludePaths = allIncludePathSet.toList();
QList<FileNode *> includedHeaderFiles;
QList<FileNode *> unusedFileNodes;
std::tie(includedHeaderFiles, unusedFileNodes)
= Utils::partition(allFiles, [&allIncludePaths](const FileNode *fn) -> bool {
const QList<FileNode *> includedHeaderFiles
= Utils::filtered(allFiles, [&allIncludePaths](const FileNode *fn) -> bool {
if (fn->fileType() != FileType::Header)
return false;
for (const FileName &inc : allIncludePaths) {
if (fn->filePath().isChildOf(inc))
return true;
}
return false;
return Utils::contains(allIncludePaths, [fn](const FileName &inc) { return fn->filePath().isChildOf(inc); });
});
const auto knownFiles = QSet<FileName>::fromList(Utils::transform(m_files, [](const FileNode *fn) { return fn->filePath(); }));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment