# HG changeset patch # User Pierre-Yves David # Date 2014-10-02 23:25:37 # 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 --git a/mercurial/revset.py b/mercurial/revset.py --- a/mercurial/revset.py +++ b/mercurial/revset.py @@ -2436,8 +2436,11 @@ class lazyset(abstractsmartset): 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