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.
--- 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.