# HG changeset patch # User Sune Foldager # Date 2010-02-23 16:37:40 # Node ID e3eff76552f14981501454cc173411d756a9bf24 # Parent ed87b6c60e0be7934f35530401b02667b06a853a hgweb: use string join instead of slower cStringIO diff --git a/mercurial/hgweb/protocol.py b/mercurial/hgweb/protocol.py --- a/mercurial/hgweb/protocol.py +++ b/mercurial/hgweb/protocol.py @@ -64,10 +64,7 @@ def branches(repo, req): 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