From 5f91f21549b30495625660a1b532a826f31d97a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A9renger=20Dalle-Cort?= Date: Sun, 20 Oct 2024 19:31:13 -0400 Subject: [PATCH] fixup! feat(Node): add AdjacentNodesCache to get children, successors, predecessors, etc. --- src/ndbl/core/Node.cpp | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/src/ndbl/core/Node.cpp b/src/ndbl/core/Node.cpp index 7daacd24e..154305aa2 100644 --- a/src/ndbl/core/Node.cpp +++ b/src/ndbl/core/Node.cpp @@ -297,28 +297,11 @@ void Node::set_adjacent_cache_dirty() const std::vector& Node::AdjacentNodesCache::get(SlotFlags flags ) const { -#ifdef NDBL_DEBUG - static size_t update_count = 0; - static size_t read_count = 0; -#endif - if ( _cache.find(flags) == _cache.end() ) { auto _this = const_cast(this); _this->_cache.insert_or_assign(flags, Utils::get_adjacent_nodes( _node, flags ) ); - -#ifdef NDBL_DEBUG - update_count++; -#endif } -#ifdef NDBL_DEBUG - else - read_count++; -#endif - -#ifdef NDBL_DEBUG - LOG_MESSAGE("AdjacentNodesCache", "%i reads for %i updates)\n", read_count, update_count); -#endif return _cache.at(flags); } \ No newline at end of file