revset: uncache filteredset.__contains__
authorYuya Nishihara <yuya@tcha.org>
Sat, 05 Sep 2015 12:56:53 +0900
changeset 26212 0d8df1f510c6
parent 26211 ea489d94e1dc
child 26213 4d6cdea33f37
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.
mercurial/revset.py
--- a/mercurial/revset.py	Sat Aug 22 17:08:37 2015 -0700
+++ b/mercurial/revset.py	Sat Sep 05 12:56:53 2015 +0900
@@ -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)