From 61d29440aae4713320083d81df1c9745c638aca0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Smr=C5=BE?= Date: Sat, 20 Nov 2021 23:25:09 +0100 Subject: Storage: fix filterAncestor to check all possible successors --- include/erebos/storage.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/erebos/storage.h b/include/erebos/storage.h index 2581dd7..24a59df 100644 --- a/include/erebos/storage.h +++ b/include/erebos/storage.h @@ -496,11 +496,17 @@ void filterAncestors(std::vector> & xs) for (auto i = old.begin(); i != old.end(); i++) { bool add = true; - for (auto j = i + 1; j != old.end(); j++) - if (i->precedes(*j)) { + for (const auto & x : xs) + if (i->precedes(x)) { add = false; break; } + if (add) + for (auto j = i + 1; j != old.end(); j++) + if (i->precedes(*j)) { + add = false; + break; + } if (add) xs.push_back(std::move(*i)); } -- cgit v1.2.3