From e4f6bc7eb172a760ee684abc0e95da578cb76716 Mon Sep 17 00:00:00 2001
From: NAUD Maxence <maxence.naud@cea.fr>
Date: Tue, 27 Aug 2024 14:31:16 +0000
Subject: [PATCH] remove find() call before emplace() in map as a search is
 already performed in the function

---
 src/graph/GraphView.cpp | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/graph/GraphView.cpp b/src/graph/GraphView.cpp
index c9f3cd14d..b203b60bb 100644
--- a/src/graph/GraphView.cpp
+++ b/src/graph/GraphView.cpp
@@ -229,9 +229,7 @@ void Aidge::GraphView::setNodesName() const {
     std::map<std::string, std::int32_t> typeIds;
     for (const auto& nodePtr: getNodes()) {
         const std::string& t = nodePtr->getOperator()->type();
-        if (typeIds.find(t) == typeIds.cend()) {
-            typeIds.emplace(t, 0);
-        }
+        typeIds.emplace(t, 0);
         const std::string nodeName = name() + std::string("_") + t + std::string("#") + std::to_string(typeIds[t]++);
         nodePtr->setName(nodeName);
     }
-- 
GitLab