summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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));
}
}