summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/dijkstra.cpp2
-rw-r--r--src/path-search-result.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/dijkstra.cpp b/src/dijkstra.cpp
index ef980ee6..69711453 100644
--- a/src/dijkstra.cpp
+++ b/src/dijkstra.cpp
@@ -108,7 +108,7 @@ void set_result_from_idx(path_search_result& result, const std::vector<visited>&
path.clear();
const auto& to_node = nodes[idx];
- if (to != to_node.pt)
+ if (result.is_found() && to != to_node.pt)
path.push_back(to);
result.set_cost(to_node.dist);
diff --git a/src/path-search-result.cpp b/src/path-search-result.cpp
index fe420475..50e9173a 100644
--- a/src/path-search-result.cpp
+++ b/src/path-search-result.cpp
@@ -34,7 +34,7 @@ path_search_result::path_search_result()
path_search_result::~path_search_result() noexcept
{
- if (_node) [[likely]]
+ if (_node && _node->vec.capacity() > 0) [[likely]]
{
_node->vec.clear();
_node->_next = std::move(_pool);