changeset 30906:72f25e17af9d

localrepo: avoid unnecessary sorting headrevs output already sorted, no need to sort it again.
author Stanislau Hlebik <stash@fb.com>
date Mon, 13 Feb 2017 02:31:56 -0800
parents 6037caa6a2f3
children 455677a7667f
files mercurial/localrepo.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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)