From f646e90dc37c703ecd8552e9098da283f9cc4c09 Mon Sep 17 00:00:00 2001
From: NAUD Maxence <maxence.naud@cea.fr>
Date: Tue, 7 Nov 2023 10:06:18 +0000
Subject: [PATCH] [Upd] simplify removeView() member function in Node.hpp

---
 include/aidge/graph/Node.hpp | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/include/aidge/graph/Node.hpp b/include/aidge/graph/Node.hpp
index 1d8449ac2..f1d0a39d4 100644
--- a/include/aidge/graph/Node.hpp
+++ b/include/aidge/graph/Node.hpp
@@ -258,9 +258,7 @@ public:
   }
 
   inline void removeView(const std::shared_ptr<GraphView> &graphPtr) {
-    std::set<std::weak_ptr<GraphView>, weakCompare>::const_iterator viewIt = mViews.cbegin();
-    for (; (viewIt != mViews.cend()) && ((*viewIt).lock() != graphPtr) ; ++viewIt) {}
-    mViews.erase(*viewIt);
+    mViews.erase(graphPtr);
   }
 
   /**
@@ -402,7 +400,7 @@ public:
 
   /**
    * @brief  Get the set of pointers to connected node at a distance of a delta.
-   * @details the recution are cut 
+   * @details the recution are cut
    * Return a nullptr is nofing found.
    * @param delta Input delta.
    * @return std::shared_ptr<Node>
-- 
GitLab