From 812665a9e3733bdc5de879a00324a8232684d8ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nils-Lucas=20Scho=CC=88nfeld?= Date: Fri, 26 Jun 2026 01:12:31 +0200 Subject: [PATCH] optimizing path state culling calling _new_path_table.get(...) in path state culling is very inefficient here. It might be better to use _new_path_table.exist(...) to use the fast index (from ram) without reading the full entry (from flash). --- src/microReticulum/Transport.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/microReticulum/Transport.cpp b/src/microReticulum/Transport.cpp index 7426d79..e3e7d49 100644 --- a/src/microReticulum/Transport.cpp +++ b/src/microReticulum/Transport.cpp @@ -694,8 +694,7 @@ DestinationEntry empty_destination_entry; std::vector stale_path_states; stale_path_states.reserve(_path_states.size()); for (const auto& [destination_hash, state] : _path_states) { - DestinationEntry destination_entry; - if (!_new_path_table.get(destination_hash, destination_entry) || !destination_entry) { + if (!_new_path_table.exists(destination_hash)) { stale_path_states.push_back(destination_hash); } }