# HG changeset patch # User Pierre-Yves David # Date 2014-04-26 01:00:07 # Node ID e2031c8ca4f8939a21fea454cb64b7a2744d9c8d # Parent 1d7a2771aa36e00770dc6c13def7371b637b5736 revset: also inline spanset._contained in __len__ For consistency with what happen in `__contains__`, we inline the range test into `__len__` too. diff --git a/mercurial/revset.py b/mercurial/revset.py --- a/mercurial/revset.py +++ b/mercurial/revset.py @@ -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