From dcba1cfaadeff21baf65a54b964eaa3b20780cdd Mon Sep 17 00:00:00 2001 From: Dwight Guth Date: Wed, 27 Nov 2024 13:18:32 -0600 Subject: [PATCH] optimize search when only one state is active --- runtime/util/search.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/runtime/util/search.cpp b/runtime/util/search.cpp index 4c52f5abf..a0d8519f6 100644 --- a/runtime/util/search.cpp +++ b/runtime/util/search.cpp @@ -72,7 +72,11 @@ std::unordered_set take_search_steps( while (!states.empty() && depth != 0) { state = states.front(); states.pop_front(); - states_set.erase(state); + if (states.size() == 0) { + states_set.clear(); + } else { + states_set.erase(state); + } if (depth > 0) { depth--;