Mercurial > public > mercurial-scm > hg
comparison mercurial/revset.py @ 21215:717ba2c3c9da stable
orderedlazyset: directly use __contains__ instead of a lambda
We apply the same speedup as in spanset, getting rid of the useless lambda.
(No new timing, as this is the very same change)
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Thu, 01 May 2014 12:15:28 -0700 |
parents | 0952904dc1e5 |
children | 2195ac506c6a |
comparison
equal
deleted
inserted
replaced
21214:0952904dc1e5 | 21215:717ba2c3c9da |
---|---|
2417 def descending(self): | 2417 def descending(self): |
2418 if self._ascending: | 2418 if self._ascending: |
2419 self.reverse() | 2419 self.reverse() |
2420 | 2420 |
2421 def __and__(self, x): | 2421 def __and__(self, x): |
2422 return orderedlazyset(self, lambda r: r in x, | 2422 return orderedlazyset(self, x.__contains__, |
2423 ascending=self._ascending) | 2423 ascending=self._ascending) |
2424 | 2424 |
2425 def __sub__(self, x): | 2425 def __sub__(self, x): |
2426 return orderedlazyset(self, lambda r: r not in x, | 2426 return orderedlazyset(self, lambda r: r not in x, |
2427 ascending=self._ascending) | 2427 ascending=self._ascending) |