changeset 22857:88e8a18329d3

baseset: drop custom __sub__ method This add method is enforcing non-laziness, disabling multiple optimisations. Benchmarks do not spot any significant difference but real usecase may. This will also be important for further improvements to addset later in this series.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Thu, 09 Oct 2014 04:29:18 -0700
parents c1546d7400ef
children d7cedb32a8ab
files mercurial/revset.py
diffstat 1 files changed, 0 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/revset.py	Thu Oct 09 04:27:25 2014 -0700
+++ b/mercurial/revset.py	Thu Oct 09 04:29:18 2014 -0700
@@ -2369,19 +2369,6 @@
     def __len__(self):
         return len(self._list)
 
-    def __sub__(self, other):
-        """Returns a new object with the substraction of the two collections.
-
-        This is part of the mandatory API for smartset."""
-        # If we are operating on 2 baseset, do the computation now since all
-        # data is available. The alternative is to involve a filteredset, which
-        # may be slow.
-        if isinstance(other, baseset):
-            other = other.set()
-            return baseset([x for x in self if x not in other])
-
-        return self.filter(lambda x: x not in other)
-
     def isascending(self):
         """Returns True if the collection is ascending order, False if not.