From f3056e49c3b2443c5dd9abf78c46381fdbbbd731 Mon Sep 17 00:00:00 2001 From: Ivan Komissarov Date: Tue, 19 Feb 2019 23:13:54 +0100 Subject: Fix calls to non-const begin()/end() in range-for loops This fixes -Wclazy-range-loop Change-Id: I08a435b700017cdbe27fbfdbda6e26840d9a3568 Reviewed-by: Christian Kandeler Reviewed-by: Denis Shienkov --- src/lib/corelib/buildgraph/inputartifactscanner.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/lib/corelib/buildgraph/inputartifactscanner.cpp') 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(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()) -- cgit v1.2.3