# HG changeset patch # User Pierre-Yves David # Date 2014-10-09 11:27:25 # Node ID c1546d7400efcd54fe238b1ffb526f230ef87463 # Parent b5492b6bc7e864a0869c634bbf92b3d7eb031ab8 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. diff --git a/mercurial/revset.py b/mercurial/revset.py --- a/mercurial/revset.py +++ b/mercurial/revset.py @@ -2382,12 +2382,6 @@ class baseset(abstractsmartset): 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.