Skip to content
Snippets Groups Projects
Commit 85726d66 authored by Olivier BICHLER's avatar Olivier BICHLER
Browse files

Fixed use ref for const

parent 19cdd7c7
No related branches found
No related tags found
1 merge request!1190.2.1
Pipeline #44833 failed
...@@ -964,7 +964,7 @@ bool Aidge::GraphView::replace(const std::shared_ptr<GraphView>& oldGraph, const ...@@ -964,7 +964,7 @@ bool Aidge::GraphView::replace(const std::shared_ptr<GraphView>& oldGraph, const
} }
} }
for (std::size_t o = 0; o < oldOOut.size(); ++o) { for (std::size_t o = 0; o < oldOOut.size(); ++o) {
for (const auto child : outputChildren[o]) { for (const auto& child : outputChildren[o]) {
newOOut[o].first -> addChild(child.first, newOOut[o].second, child.second); newOOut[o].first -> addChild(child.first, newOOut[o].second, child.second);
} }
} }
...@@ -978,7 +978,7 @@ bool Aidge::GraphView::replace(const std::shared_ptr<GraphView>& oldGraph, const ...@@ -978,7 +978,7 @@ bool Aidge::GraphView::replace(const std::shared_ptr<GraphView>& oldGraph, const
// Same number of inputs and outputs: connect each input to the corresponding output // Same number of inputs and outputs: connect each input to the corresponding output
for (std::size_t i = 0; i < oldOIn.size(); ++i) { for (std::size_t i = 0; i < oldOIn.size(); ++i) {
if (inputParents[i].first) { if (inputParents[i].first) {
for (const auto child : outputChildren[i]) { for (const auto& child : outputChildren[i]) {
inputParents[i].first -> addChild(child.first, inputParents[i].second, child.second); inputParents[i].first -> addChild(child.first, inputParents[i].second, child.second);
} }
} }
...@@ -987,7 +987,7 @@ bool Aidge::GraphView::replace(const std::shared_ptr<GraphView>& oldGraph, const ...@@ -987,7 +987,7 @@ bool Aidge::GraphView::replace(const std::shared_ptr<GraphView>& oldGraph, const
else if ((oldOIn.size() == 1) && (inputParents[0].first)) { else if ((oldOIn.size() == 1) && (inputParents[0].first)) {
// Single input: connect the only input to all the outputs // Single input: connect the only input to all the outputs
for (std::size_t i = 0; i < oldOOut.size(); ++i) { for (std::size_t i = 0; i < oldOOut.size(); ++i) {
for (const auto child : outputChildren[i]) { for (const auto& child : outputChildren[i]) {
inputParents[0].first -> addChild(child.first, inputParents[0].second, child.second); inputParents[0].first -> addChild(child.first, inputParents[0].second, child.second);
} }
} }
...@@ -1010,7 +1010,7 @@ bool Aidge::GraphView::replace(const std::shared_ptr<GraphView>& oldGraph, const ...@@ -1010,7 +1010,7 @@ bool Aidge::GraphView::replace(const std::shared_ptr<GraphView>& oldGraph, const
} }
} }
for (std::size_t o = 0; o < oldOOut.size(); ++o) { for (std::size_t o = 0; o < oldOOut.size(); ++o) {
for (const auto child : outputChildren[o]) { for (const auto& child : outputChildren[o]) {
newOOut[o].first -> addChild(child.first, newOOut[o].second, child.second); newOOut[o].first -> addChild(child.first, newOOut[o].second, child.second);
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment