Mercurial > hg > mercurial-source
diff mercurial/revset.py @ 26820:0d8df1f510c6
revset: uncache filteredset.__contains__
Since 96b6b3d78697, condition function returns a cached value, so there's
little benefit to cache __contains__.
No measurable difference found in contrib/base-revsets.txt.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sat, 05 Sep 2015 12:56:53 +0900 (2015-09-05) |
parents | 42bb1812686f |
children | 43f9976346e9 |
line wrap: on
line diff
--- a/mercurial/revset.py +++ b/mercurial/revset.py @@ -3077,14 +3077,9 @@ """ self._subset = subset self._condition = condition - self._cache = {} def __contains__(self, x): - c = self._cache - if x not in c: - v = c[x] = x in self._subset and self._condition(x) - return v - return c[x] + return x in self._subset and self._condition(x) def __iter__(self): return self._iterfilter(self._subset)