summaryrefslogtreecommitdiff
path: root/include/erebos
diff options
context:
space:
mode:
authorRoman Smrž <roman.smrz@seznam.cz>2021-11-20 23:25:09 +0100
committerRoman Smrž <roman.smrz@seznam.cz>2021-11-20 23:25:09 +0100
commit61d29440aae4713320083d81df1c9745c638aca0 (patch)
tree08be1a360bd7836459e614635f57c11e8cbb57ca /include/erebos
parent947276015593c937d86955b644d4a88f8e23b7a8 (diff)
Storage: fix filterAncestor to check all possible successors
Diffstat (limited to 'include/erebos')
-rw-r--r--include/erebos/storage.h10
1 files changed, 8 insertions, 2 deletions
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,12 +496,18 @@ void filterAncestors(std::vector<Stored<T>> & 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));
}
}