aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/corelib/buildgraph/inputartifactscanner.cpp
diff options
context:
space:
mode:
authorIvan Komissarov <ABBAPOH@gmail.com>2019-02-19 23:13:54 +0100
committerIvan Komissarov <ABBAPOH@gmail.com>2019-03-06 18:13:43 +0000
commitf3056e49c3b2443c5dd9abf78c46381fdbbbd731 (patch)
treed435db1321f25287eda1481ba16b9d3cfab4b40a /src/lib/corelib/buildgraph/inputartifactscanner.cpp
parent967d67664b53169bf958dc1ea61ab014d16c56e6 (diff)
Fix calls to non-const begin()/end() in range-for loops
This fixes -Wclazy-range-loop Change-Id: I08a435b700017cdbe27fbfdbda6e26840d9a3568 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
Diffstat (limited to 'src/lib/corelib/buildgraph/inputartifactscanner.cpp')
-rw-r--r--src/lib/corelib/buildgraph/inputartifactscanner.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/lib/corelib/buildgraph/inputartifactscanner.cpp b/src/lib/corelib/buildgraph/inputartifactscanner.cpp
index 68f3b744b..48722186d 100644
--- a/src/lib/corelib/buildgraph/inputartifactscanner.cpp
+++ b/src/lib/corelib/buildgraph/inputartifactscanner.cpp
@@ -77,8 +77,9 @@ static void resolveDepencency(const RawScannedDependency &dependency,
FileDependency *fileDependencyArtifact = nullptr;
Artifact *dependencyInProduct = nullptr;
Artifact *dependencyInOtherProduct = nullptr;
- for (FileResourceBase *lookupResult : project->topLevelProject()
- ->buildData->lookupFiles(absDirPath, dependency.fileName())) {
+ const auto files = project->topLevelProject()
+ ->buildData->lookupFiles(absDirPath, dependency.fileName());
+ for (FileResourceBase *lookupResult : files) {
switch (lookupResult->fileType()) {
case FileResourceBase::FileTypeDependency:
fileDependencyArtifact = static_cast<FileDependency *>(lookupResult);
@@ -274,7 +275,7 @@ void InputArtifactScanner::resolveScanResultDependencies(const Artifact *inputAr
}
// try include paths
- for (const QString &includePath : cache.searchPaths) {
+ for (const QString &includePath : qAsConst(cache.searchPaths)) {
resolveDepencency(dependency, inputArtifact->product.get(),
&resolvedDependency, includePath);
if (resolvedDependency.isValid())