[PATCH 1 of 2] churn: use genexps now that we dropped 2.3 compatibility

Nicolas Dumazet nicdumz at gmail.com
Mon Aug 24 08:18:54 CDT 2009


# HG changeset patch
# User Nicolas Dumazet <nicdumz.commits at gmail.com>
# Date 1251119351 -7200
# Node ID a4c7cc7dabcb4498e535a1f38d68338cc7b8f87a
# Parent  9482b68bcf002b0f9fcc8430ffd9680c63ad2c54
churn: use genexps now that we dropped 2.3 compatibility

diff --git a/hgext/churn.py b/hgext/churn.py
--- a/hgext/churn.py
+++ b/hgext/churn.py
@@ -148,8 +148,8 @@
     sortkey = ((not opts.get('sort')) and (lambda x: -x[1]) or None)
     rate.sort(key=sortkey)
 
-    maxcount = float(max([v for k, v in rate]))
-    maxname = max([len(k) for k, v in rate])
+    maxcount = float(max(v for k, v in rate))
+    maxname = max(len(k) for k, v in rate)
 
     ttywidth = util.termwidth()
     ui.debug(_("assuming %i character terminal\n") % ttywidth)


More information about the Mercurial-devel mailing list