Project: Avoid copying the entire files(...) list

Avoid copying the entire list of files known to a project just to
filter out a couple of files from it.

Change-Id: I58b2e323f9678058ba482353eb777a55189fe05d
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
Tobias Hunger
2019-06-18 16:21:56 +02:00
parent 30df84e177
commit e2d6c0bfea
6 changed files with 29 additions and 22 deletions

View File

@@ -764,7 +764,11 @@ static void notifyChangedHelper(const FilePath &fileName, QmakeProFile *file)
void QmakeProject::notifyChanged(const FilePath &name)
{
for (QmakeProject *project : s_projects) {
if (project->files(QmakeProject::SourceFiles).contains(name))
if (!project
->files([&name](const ProjectExplorer::Node *n) {
return Project::SourceFiles(n) && n->filePath() == name;
})
.isEmpty())
notifyChangedHelper(name, project->rootProFile());
}
}