mirror of
https://github.com/facebook/sapling.git
synced 2024-10-08 15:57:43 +03:00
revset: also inline spanset._contained in __len__
For consistency with what happen in `__contains__`, we inline the range test into `__len__` too.
This commit is contained in:
parent
b42c62324c
commit
a4f88556f4
@ -2822,8 +2822,10 @@ class spanset(_orderedsetmixin):
|
||||
return abs(self._end - self._start)
|
||||
else:
|
||||
count = 0
|
||||
start = self._start
|
||||
end = self._end
|
||||
for rev in self._hiddenrevs:
|
||||
if self._contained(rev):
|
||||
if (end < rev <= start) or (start <= rev and rev < end):
|
||||
count += 1
|
||||
return abs(self._end - self._start) - count
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user