From 2dd2d6095584b957b243bb86948b13223ecb39b3 Mon Sep 17 00:00:00 2001 From: maxint Date: Sat, 10 Oct 2020 07:13:23 +0000 Subject: [PATCH] Fix warnings: "-Wrange-loop-construct" in gapi --- modules/gapi/src/backends/fluid/gfluidbackend.cpp | 4 ++-- modules/gapi/src/compiler/passes/exec.cpp | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/gapi/src/backends/fluid/gfluidbackend.cpp b/modules/gapi/src/backends/fluid/gfluidbackend.cpp index 9b95dff036..030bb10198 100644 --- a/modules/gapi/src/backends/fluid/gfluidbackend.cpp +++ b/modules/gapi/src/backends/fluid/gfluidbackend.cpp @@ -952,7 +952,7 @@ namespace using namespace cv::gimpl; GModel::Graph g(graph); GFluidModel fg(graph); - for (const auto node : g.nodes()) + for (const auto& node : g.nodes()) { if (g.metadata(node).get().t == NodeType::DATA) { @@ -1440,7 +1440,7 @@ void GFluidBackendImpl::addMetaSensitiveBackendPasses(ade::ExecutionEngineSetupC { // Add FluidData to all data nodes inside island, // set internal = true if node is not a slot in terms of higher-level GIslandModel - for (const auto node : isl->contents()) + for (const auto& node : isl->contents()) { if (g.metadata(node).get().t == NodeType::DATA && !fg.metadata(node).contains()) diff --git a/modules/gapi/src/compiler/passes/exec.cpp b/modules/gapi/src/compiler/passes/exec.cpp index 755538bb46..0eb8352b76 100644 --- a/modules/gapi/src/compiler/passes/exec.cpp +++ b/modules/gapi/src/compiler/passes/exec.cpp @@ -71,12 +71,12 @@ namespace all.insert(src_g.nodes().begin(), src_g.nodes().end()); - for (const auto nh : proto.in_nhs) + for (const auto& nh : proto.in_nhs) { all.erase(nh); in_ops.insert(nh->outNodes().begin(), nh->outNodes().end()); } - for (const auto nh : proto.out_nhs) + for (const auto& nh : proto.out_nhs) { all.erase(nh); out_ops.insert(nh->inNodes().begin(), nh->inNodes().end()); @@ -90,12 +90,12 @@ namespace auto ih = GIslandModel::mkIslandNode(g, std::move(isl)); - for (const auto nh : proto.in_nhs) + for (const auto& nh : proto.in_nhs) { auto slot = GIslandModel::mkSlotNode(g, nh); g.link(slot, ih); } - for (const auto nh : proto.out_nhs) + for (const auto& nh : proto.out_nhs) { auto slot = GIslandModel::mkSlotNode(g, nh); g.link(ih, slot);