aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/corelib/buildgraph
diff options
context:
space:
mode:
authorIvan Komissarov <abbapoh@gmail.com>2021-04-23 03:43:55 +0300
committerIvan Komissarov <ABBAPOH@gmail.com>2021-08-16 10:05:48 +0000
commit4d85d558597f9405b9c9d20446156cd63d5b09c2 (patch)
treed70dd5a60a046d88c91759159deca651a88d9449 /src/lib/corelib/buildgraph
parent8b259164f2dbbfb1c87de20acbb1d3592e2a3b8c (diff)
Get rid of Set::to/from methods
... and replace them with the new template rangeTo method Also, add efficient Set(Iter, Iter) ctor. Change-Id: I5a2345ca84373692e3ba815e5a8f38cb4cfc4308 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src/lib/corelib/buildgraph')
-rw-r--r--src/lib/corelib/buildgraph/artifactcleaner.cpp2
-rw-r--r--src/lib/corelib/buildgraph/buildgraph.cpp3
-rw-r--r--src/lib/corelib/buildgraph/depscanner.cpp2
-rw-r--r--src/lib/corelib/buildgraph/executor.cpp2
-rw-r--r--src/lib/corelib/buildgraph/rulesapplicator.cpp2
5 files changed, 5 insertions, 6 deletions
diff --git a/src/lib/corelib/buildgraph/artifactcleaner.cpp b/src/lib/corelib/buildgraph/artifactcleaner.cpp
index 03b327232..6239a138b 100644
--- a/src/lib/corelib/buildgraph/artifactcleaner.cpp
+++ b/src/lib/corelib/buildgraph/artifactcleaner.cpp
@@ -181,7 +181,7 @@ void ArtifactCleaner::cleanup(const TopLevelProjectPtr &project,
// Directories created during the build are not artifacts (TODO: should they be?),
// so we have to clean them up manually.
- QList<QString> dirList = directories.toList();
+ auto dirList = rangeTo<QStringList>(directories);
for (int i = 0; i < dirList.size(); ++i) {
const QString &dir = dirList.at(i);
if (!dir.startsWith(project->buildDirectory))
diff --git a/src/lib/corelib/buildgraph/buildgraph.cpp b/src/lib/corelib/buildgraph/buildgraph.cpp
index 0d5e8a1f0..82dae98b5 100644
--- a/src/lib/corelib/buildgraph/buildgraph.cpp
+++ b/src/lib/corelib/buildgraph/buildgraph.cpp
@@ -850,8 +850,7 @@ void doSanityChecks(const ResolvedProjectPtr &project, const Logger &logger)
if (qEnvironmentVariableIsEmpty("QBS_SANITY_CHECKS"))
return;
Set<QString> productNames;
- const Set<ResolvedProductPtr> allProducts
- = Set<ResolvedProductPtr>::fromStdVector(project->allProducts());
+ const auto allProducts = rangeTo<Set<ResolvedProductPtr>>(project->allProducts());
doSanityChecks(project, allProducts, productNames, logger);
}
diff --git a/src/lib/corelib/buildgraph/depscanner.cpp b/src/lib/corelib/buildgraph/depscanner.cpp
index 0bf644286..3f37841d9 100644
--- a/src/lib/corelib/buildgraph/depscanner.cpp
+++ b/src/lib/corelib/buildgraph/depscanner.cpp
@@ -127,7 +127,7 @@ QStringList PluginDependencyScanner::collectDependencies(Artifact *artifact, Fil
result += outFilePath;
}
m_plugin->close(scannerHandle);
- return result.toList();
+ return rangeTo<QStringList>(result);
}
bool PluginDependencyScanner::recursive() const
diff --git a/src/lib/corelib/buildgraph/executor.cpp b/src/lib/corelib/buildgraph/executor.cpp
index 377222d21..9ef51d95f 100644
--- a/src/lib/corelib/buildgraph/executor.cpp
+++ b/src/lib/corelib/buildgraph/executor.cpp
@@ -193,7 +193,7 @@ public:
allDependencies += dep;
}
const Set<ResolvedProductPtr> rootProducts
- = Set<ResolvedProductPtr>::fromStdVector(m_allProducts) - allDependencies;
+ = rangeTo<Set<ResolvedProductPtr>>(m_allProducts) - allDependencies;
m_priority = UINT_MAX;
m_seenProducts.clear();
for (const ResolvedProductPtr &rootProduct : rootProducts)
diff --git a/src/lib/corelib/buildgraph/rulesapplicator.cpp b/src/lib/corelib/buildgraph/rulesapplicator.cpp
index 0d36e1e21..f464734b8 100644
--- a/src/lib/corelib/buildgraph/rulesapplicator.cpp
+++ b/src/lib/corelib/buildgraph/rulesapplicator.cpp
@@ -228,7 +228,7 @@ void RulesApplicator::doApply(const ArtifactSet &inputArtifacts, QScriptValue &p
}
}
- ArtifactSet newOutputs = ArtifactSet::fromList(outputArtifacts);
+ const auto newOutputs = rangeTo<ArtifactSet>(outputArtifacts);
const ArtifactSet oldOutputs = collectOldOutputArtifacts(inputArtifacts);
handleRemovedRuleOutputs(m_completeInputSet, oldOutputs - newOutputs, m_removedArtifacts,
m_logger);