From 16a70b56f9fbbdf23f363439e60b15c6243f2ed8 Mon Sep 17 00:00:00 2001 From: idealbuq <iryna.dealbuquerquesilva@cea.fr> Date: Mon, 17 Mar 2025 15:46:38 +0000 Subject: [PATCH] Removed unnecessary while-loop when checking for duplicate node names. --- src/graph/GraphView.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/graph/GraphView.cpp b/src/graph/GraphView.cpp index 066832520..b0704e0e9 100644 --- a/src/graph/GraphView.cpp +++ b/src/graph/GraphView.cpp @@ -694,11 +694,7 @@ void Aidge::GraphView::add(std::shared_ptr<Node> node, bool includeLearnablePara } else { // Different instance with the same name – generate an unique name 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 it to {}.\n", node->name(), newName); node->setName(newName); -- GitLab