Mercurial > hg-stable
changeset 22719:21fda9dcd4e8
lazyset: split the iteration logic from the condition filtering logic
So that the filter can be reused by `fastasc` or `fastdesc`.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Thu, 02 Oct 2014 18:25:37 -0500 |
parents | 7b123e5639f4 |
children | 4388f99c5512 |
files | mercurial/revset.py |
diffstat | 1 files changed, 4 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- 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