Patchwork [3,of,5] cmdutil: use a generator expression instead of a list comprehension

login
register
mail settings
Submitter Augie Fackler
Date May 22, 2017, 7:09 p.m.
Message ID <c5a0e9dff4d033e0d1c3.1495480161@augie-macbookpro2.roam.corp.google.com>
Download mbox | patch
Permalink /patch/20838/
State Accepted
Headers show

Comments

Augie Fackler - May 22, 2017, 7:09 p.m.
# HG changeset patch
# User Augie Fackler <augie@google.com>
# Date 1495474522 14400
#      Mon May 22 13:35:22 2017 -0400
# Node ID c5a0e9dff4d033e0d1c312ddbcae70e6d91df5c0
# Parent  027b540c089253b9c600cc36e638953b0f9c5d14
cmdutil: use a generator expression instead of a list comprehension

Patch

diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -1169,7 +1169,7 @@  def export(repo, revs, fntemplate='hg-%h
     '''
 
     total = len(revs)
-    revwidth = max([len(str(rev)) for rev in revs])
+    revwidth = max(len(str(rev)) for rev in revs)
     filemode = {}
 
     def single(rev, seqno, fp):