allow streams to marked as exhausted in more cases

At stream boundaries, we can mark streams as exhausted if there are no
groups active and there are no other ways to report matches. This allows us
to stop maintaining the history buffer on subsequent stream writes.
Previously, streams were only marked as exhausted if a pure highlander case
reported all patterns or the outfix in a sole outfix case died.
This commit is contained in:
Alex Coyte
2017-01-31 09:29:41 +11:00
committed by Matthew Barr
parent fbaa0a1b25
commit bbd64f98ae
11 changed files with 171 additions and 30 deletions

View File

@@ -202,6 +202,17 @@ void erase_all(C *container, const D &donor) {
}
}
template<typename C, typename Pred>
bool any_of_in(const C &c, Pred p) {
return std::any_of(c.begin(), c.end(), std::move(p));
}
template<typename C, typename Pred>
bool all_of_in(const C &c, Pred p) {
return std::all_of(c.begin(), c.end(), std::move(p));
}
} // namespace ue2
#ifdef DUMP_SUPPORT