templater: remove cStringIO for fill
authorMatt Mackall <mpm@selenic.com>
Mon, 13 Nov 2006 13:26:57 -0600
changeset 3633 bf3dec184c78
parent 3632 231393b7316f
child 3634 6a46c9ccc2ed
templater: remove cStringIO for fill
mercurial/templater.py
--- a/mercurial/templater.py	Mon Nov 13 13:26:57 2006 -0600
+++ b/mercurial/templater.py	Mon Nov 13 13:26:57 2006 -0600
@@ -204,11 +204,8 @@
             yield text[start:m.start(0)], m.group(1)
             start = m.end(1)
 
-    fp = cStringIO.StringIO()
-    for para, rest in findparas():
-        fp.write(space_re.sub(' ', textwrap.fill(para, width)))
-        fp.write(rest)
-    return fp.getvalue()
+    return "".join([space_re.sub(' ', textwrap.fill(para, width)) + rest
+                    for para, rest in findparas()])
 
 def firstline(text):
     '''return the first line of text'''