revpair: use `first` and `last` instead of direct indexing
authorPierre-Yves David <pierre-yves.david@fb.com>
Mon, 06 Oct 2014 23:37:39 -0700
changeset 22816 20d998395ee7
parent 22815 4f81470e83bf
child 22817 e4eb4bfc3616
revpair: use `first` and `last` instead of direct indexing This makes it compatible with all smarsets classes.
mercurial/scmutil.py
--- a/mercurial/scmutil.py	Mon Oct 06 23:37:08 2014 -0700
+++ b/mercurial/scmutil.py	Mon Oct 06 23:37:39 2014 -0700
@@ -497,9 +497,8 @@
         first = l.max()
         second = l.min()
     else:
-        l = list(l)
-        first = l[0]
-        second = l[-1]
+        first = l.first()
+        second = l.last()
 
     if first is None:
         raise util.Abort(_('empty revision range'))