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

Make getNodes() return a const ref

parent a0bf5e8d
No related branches found
No related tags found
No related merge requests found
......@@ -208,7 +208,7 @@ public:
* @brief Get the Nodes pointed to by the GraphView object.
* @return std::set<NodePtr>
*/
inline std::set<NodePtr> getNodes() const { return mNodes; }
inline const std::set<NodePtr>& getNodes() const { return mNodes; }
/**
* @brief Get the operator with the corresponding name if it is in the
......
......@@ -39,7 +39,7 @@ std::shared_ptr<Aidge::GraphView> Aidge::generateGraph(std::vector<Connector> ct
graph->add(nodesToAdd.back()); // only add, connection already done
// between nodes
std::vector<std::shared_ptr<Node>> parents = nodesToAdd.back()->getParents();
std::set<std::shared_ptr<Node>> alreadyAdded = graph->getNodes();
const std::set<std::shared_ptr<Node>>& alreadyAdded = graph->getNodes();
for (std::shared_ptr<Node> parent : parents) {
if (alreadyAdded.find(parent) == alreadyAdded.end()) {
buffer.push_back(parent);
......
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