Mercurial > hg
changeset 22718:7b123e5639f4
spanset: do a single range check in __contains__
Now that `start <= end` is always true, we can simplify this function.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Thu, 02 Oct 2014 17:53:55 -0500 |
parents | b89f7e3a414d |
children | 21fda9dcd4e8 |
files | mercurial/revset.py |
diffstat | 1 files changed, 1 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/revset.py Thu Oct 02 18:02:17 2014 -0500 +++ b/mercurial/revset.py Thu Oct 02 17:53:55 2014 -0500 @@ -2895,10 +2895,8 @@ return iter(iterrange) def __contains__(self, rev): - start = self._start - end = self._end hidden = self._hiddenrevs - return (((end < rev <= start) or (start <= rev and rev < end)) + return ((self._start <= rev < self._end) and not (hidden and rev in hidden)) def __nonzero__(self):