localrepo: avoid unnecessary sorting
authorStanislau Hlebik <stash@fb.com>
Mon, 13 Feb 2017 02:31:56 -0800
changeset 30906 72f25e17af9d
parent 30905 6037caa6a2f3
child 30916 455677a7667f
localrepo: avoid unnecessary sorting headrevs output already sorted, no need to sort it again.
mercurial/localrepo.py
--- a/mercurial/localrepo.py	Mon Feb 13 02:26:18 2017 -0800
+++ b/mercurial/localrepo.py	Mon Feb 13 02:31:56 2017 -0800
@@ -1854,7 +1854,7 @@
     def heads(self, start=None):
         if start is None:
             cl = self.changelog
-            headrevs = sorted(cl.headrevs(), reverse=True)
+            headrevs = reversed(cl.headrevs())
             return [cl.node(rev) for rev in headrevs]
 
         heads = self.changelog.heads(start)