changeset 10531:e3eff76552f1 stable

hgweb: use string join instead of slower cStringIO
author Sune Foldager <cryo@cyanite.org>
date Tue, 23 Feb 2010 11:37:40 -0500
parents ed87b6c60e0b
children 184cdb66263e
files mercurial/hgweb/protocol.py
diffstat 1 files changed, 1 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/hgweb/protocol.py	Tue Feb 23 11:34:08 2010 -0500
+++ b/mercurial/hgweb/protocol.py	Tue Feb 23 11:37:40 2010 -0500
@@ -64,10 +64,7 @@
 def between(repo, req):
     pairs = [map(bin, p.split("-"))
              for p in req.form['pairs'][0].split(" ")]
-    resp = cStringIO.StringIO()
-    for b in repo.between(pairs):
-        resp.write(" ".join(map(hex, b)) + "\n")
-    resp = resp.getvalue()
+    resp = ''.join(" ".join(map(hex, b)) + "\n" for b in repo.between(pairs))
     req.respond(HTTP_OK, HGTYPE, length=len(resp))
     yield resp