Mercurial > hg
comparison mercurial/revset.py @ 22688:cac9b3591753
revset: drop isinstance(baseset) from baseset.__and__
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 | Tue, 30 Sep 2014 23:09:59 -0500 |
parents | d9cc1be5acec |
children | 372f507f6676 |
comparison
equal
deleted
inserted
replaced
22687:d9cc1be5acec | 22688:cac9b3591753 |
---|---|
2253 | 2253 |
2254 def __and__(self, other): | 2254 def __and__(self, other): |
2255 """Returns a new object with the intersection of the two collections. | 2255 """Returns a new object with the intersection of the two collections. |
2256 | 2256 |
2257 This is part of the mandatory API for smartset.""" | 2257 This is part of the mandatory API for smartset.""" |
2258 if isinstance(other, baseset): | |
2259 other = other.set() | |
2260 return baseset([y for y in self if y in other]) | 2258 return baseset([y for y in self if y in other]) |
2261 | 2259 |
2262 def __add__(self, other): | 2260 def __add__(self, other): |
2263 """Returns a new object with the union of the two collections. | 2261 """Returns a new object with the union of the two collections. |
2264 | 2262 |