[PATCH 2 of 2] progress: simplify spacejoin()

Brodie Rao dackze at gmail.com
Sat Feb 13 22:37:09 CST 2010


# HG changeset patch
# User Brodie Rao <me+hg at dackz.net>
# Date 1266122060 18000
# Node ID 994b75427af48674f6657b1de98b283ff415e86e
# Parent  fb45c98e42ab9bafc71edb4bd9c90238313c2320
progress: simplify spacejoin()

diff --git a/hgext/progress.py b/hgext/progress.py
--- a/hgext/progress.py
+++ b/hgext/progress.py
@@ -47,13 +47,7 @@ from mercurial import extensions
 from mercurial import util
 
 def spacejoin(*args):
-    ret = ''
-    for s in args:
-        if s:
-            if ret:
-                ret += ' '
-            ret += s
-    return ret
+    return ' '.join(s for s in args if s)
 
 class progbar(object):
     def __init__(self, ui):


More information about the Mercurial-devel mailing list