aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/corelib/buildgraph/requesteddependencies.cpp
diff options
context:
space:
mode:
authorRichard Weickelt <richard@weickelt.de>2019-12-18 20:31:10 +0100
committerRichard Weickelt <richard@weickelt.de>2019-12-19 13:52:37 +0000
commit0a6651ac364513249c17f1373cfda37a7a8a74fe (patch)
treef77f0ed48db40357eacf839d18678b95287bddc7 /src/lib/corelib/buildgraph/requesteddependencies.cpp
parent53040c40f143210c171bc4c39affe3a5df935f78 (diff)
Avoid an unnecessary copy operation
Clang-tidy warns about an unnecessary copy being made because the container is std::vector<SomePtr>, but the loop variable is SomeConstPtr&. Change-Id: I4cc640334fca4a2e58ee8ed8cebc2a3bca13f15b Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src/lib/corelib/buildgraph/requesteddependencies.cpp')
-rw-r--r--src/lib/corelib/buildgraph/requesteddependencies.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/corelib/buildgraph/requesteddependencies.cpp b/src/lib/corelib/buildgraph/requesteddependencies.cpp
index f993b2518..b95c8db94 100644
--- a/src/lib/corelib/buildgraph/requesteddependencies.cpp
+++ b/src/lib/corelib/buildgraph/requesteddependencies.cpp
@@ -48,9 +48,9 @@ namespace Internal {
static Set<QString> depNamesForProduct(const ResolvedProduct *p)
{
Set<QString> names;
- for (const ResolvedProductConstPtr &dep : p->dependencies)
+ for (const auto &dep : p->dependencies)
names.insert(dep->uniqueName());
- for (const ResolvedModuleConstPtr &m : p->modules) {
+ for (const auto &m : p->modules) {
if (!m->isProduct)
names.insert(m->name);
}
@@ -73,7 +73,7 @@ bool RequestedDependencies::isUpToDate(const TopLevelProject *project) const
{
if (m_depsPerProduct.empty())
return true;
- for (const ResolvedProductConstPtr &product : project->allProducts()) {
+ for (const auto &product : project->allProducts()) {
const auto it = m_depsPerProduct.find(product->uniqueName());
if (it == m_depsPerProduct.cend())
continue;