Patchwork [2,of,5] show: avoid extra list operations

login
register
mail settings
Submitter Gregory Szorc
Date July 4, 2017, 4:32 a.m.
Message ID <f2c118798d8bd214679f.1499142758@ubuntu-vm-main>
Download mbox | patch
Permalink /patch/21962/
State Accepted
Headers show

Comments

Gregory Szorc - July 4, 2017, 4:32 a.m.
# HG changeset patch
# User Gregory Szorc <gregory.szorc@gmail.com>
# Date 1499141524 25200
#      Mon Jul 03 21:12:04 2017 -0700
# Node ID f2c118798d8bd214679f9a6ad3f8f4f87882d9d3
# Parent  0cacc533e884965d93b426c6805a55097010dcbe
show: avoid extra list operations

Patch

diff --git a/hgext/show.py b/hgext/show.py
--- a/hgext/show.py
+++ b/hgext/show.py
@@ -219,7 +219,7 @@  def showstack(ui, repo, displayer):
             branchpointattip = True
             break
 
-    stackrevs = list(reversed(sorted(stackrevs)))
+    stackrevs = list(sorted(stackrevs, reverse=True))
 
     # Find likely target heads for the current stack. These are likely
     # merge or rebase targets.