Skip to content
Snippets Groups Projects
Commit 5916d89e authored by Iryna DE ALBUQUERQUE SILVA's avatar Iryna DE ALBUQUERQUE SILVA Committed by Cyril Moineau
Browse files

Removed redudant code in GraphView's add() methods.

parent f4f694c6
No related branches found
No related tags found
1 merge request!365Use createUniqueName() while adding nodes from a Graphview to another.
Pipeline #68519 passed
......@@ -857,10 +857,7 @@ bool Aidge::GraphView::add(std::set<std::shared_ptr<Node>> otherNodes, bool incl
for (auto node : nodesToAdd) {
if (mNodeRegistry.find(node->name()) != mNodeRegistry.end()) {
std::string newName = node->createUniqueName(node->name());
while (mNodeRegistry.find(newName) != mNodeRegistry.end()) {
newName = node->createUniqueName(newName + "_1");
}
Log::notice("node name \"{}\" is a duplicate, renaming to {}.\n", node->name(), newName);
Log::notice("Node name \"{}\" is a duplicate, renaming to {}.\n", node->name(), newName);
node->setName(newName);
}
}
......
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