baseset: drop custom __and__ method
This add method is enforcing non-laziness, disabling multiple optimisations.
Benchmarks do not spot any significant regression but real usecase may. This
even gives some speedup in some cases:
revset #15: min(0::)
before) wall 0.001247 comb 0.000000 user 0.000000 sys 0.000000 (best of 1814)
after) wall 0.000942 comb 0.000000 user 0.000000 sys 0.000000 (best of 2367)
This will also be important for further improvement to addset later in this series.
--- a/mercurial/revset.py Thu Oct 09 04:27:01 2014 -0700
+++ b/mercurial/revset.py Thu Oct 09 04:27:25 2014 -0700
@@ -2382,12 +2382,6 @@
return self.filter(lambda x: x not in other)
- def __and__(self, other):
- """Returns a new object with the intersection of the two collections.
-
- This is part of the mandatory API for smartset."""
- return baseset([y for y in self if y in other])
-
def isascending(self):
"""Returns True if the collection is ascending order, False if not.