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

Nicolas Dumazet nicdumz at gmail.com
Tue Aug 25 08:21:52 CDT 2009


# HG changeset patch
# User Nicolas Dumazet <nicdumz.commits at gmail.com>
# Date 1251119351 -7200
# Node ID 9606e055327df8d373b96547eea7d0d1e4ba380b
# Parent  4dd2742d0d07957d52c0970884a03c8de0609205
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