# HG changeset patch # User Pierre-Yves David # Date 1412292337 18000 # Node ID 21fda9dcd4e86111044a0a3172184b6721c70999 # Parent 7b123e5639f4e5304c0c2dfd5b698e1c879b6d66 lazyset: split the iteration logic from the condition filtering logic So that the filter can be reused by `fastasc` or `fastdesc`. diff -r 7b123e5639f4 -r 21fda9dcd4e8 mercurial/revset.py --- a/mercurial/revset.py Thu Oct 02 17:53:55 2014 -0500 +++ b/mercurial/revset.py Thu Oct 02 18:25:37 2014 -0500 @@ -2436,8 +2436,11 @@ return c[x] def __iter__(self): + return self._iterfilter(self._subset) + + def _iterfilter(self, it): cond = self._condition - for x in self._subset: + for x in it: if cond(x): yield x