comparison mercurial/revset.py @ 22690:d7ab5684711f

revset: drop isinstance(baseset) in spanset.__sub__ As baseset now has a fast __contains___ operator, this `baseset.set()` dance is no longer needed. No regressions are visible in the benchmark.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Wed, 01 Oct 2014 15:50:54 -0500
parents 372f507f6676
children d8a08b68f754
comparison
equal deleted inserted replaced
22689:372f507f6676 22690:d7ab5684711f
2815 def __and__(self, x): 2815 def __and__(self, x):
2816 return orderedlazyset(self, x.__contains__, 2816 return orderedlazyset(self, x.__contains__,
2817 ascending=self.isascending()) 2817 ascending=self.isascending())
2818 2818
2819 def __sub__(self, x): 2819 def __sub__(self, x):
2820 if isinstance(x, baseset):
2821 x = x.set()
2822 filterfunc = x.__contains__ 2820 filterfunc = x.__contains__
2823 return orderedlazyset(self, lambda r: not filterfunc(r), 2821 return orderedlazyset(self, lambda r: not filterfunc(r),
2824 ascending=self.isascending()) 2822 ascending=self.isascending())
2825 2823
2826 def __add__(self, x): 2824 def __add__(self, x):