Mercurial > hg
changeset 22799:bafa371d7af3
addset: drop caching through generatorset
The utility of this cache is debatable (no visible benchmark impact) and using
generatorset for such purpose makes the code complicated.
We drop it for now. Someone can reintroduce a smart version of it in the future
if it is detected to be relevant.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Fri, 03 Oct 2014 20:23:02 -0700 |
parents | 586d7058ea48 |
children | 29a8c20e14a8 |
files | mercurial/revset.py |
diffstat | 1 files changed, 13 insertions(+), 15 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/revset.py Fri Oct 03 21:01:30 2014 -0700 +++ b/mercurial/revset.py Fri Oct 03 20:23:02 2014 -0700 @@ -2499,22 +2499,20 @@ If the ascending attribute is set, iterate over both collections at the same time, yielding only one value at a time in the given order. """ - if not self._iter: - if self._ascending is None: - def gen(): - for r in self._r1: + if self._ascending is None: + def gen(): + for r in self._r1: + yield r + s = self._r1.set() + for r in self._r2: + if r not in s: yield r - s = self._r1.set() - for r in self._r2: - if r not in s: - yield r - gen = gen() - else: - iter1 = iter(self._r1) - iter2 = iter(self._r2) - gen = self._iterordered(self._ascending, iter1, iter2) - self._iter = generatorset(gen) - return self._iter + gen = gen() + else: + iter1 = iter(self._r1) + iter2 = iter(self._r2) + gen = self._iterordered(self._ascending, iter1, iter2) + return gen def __iter__(self): if self._genlist: