1. cherrypy
  2. CherryPy
Issue #929 resolved

needless work in Response.collapse_body()

created an issue

In _cprequest.py, class Response:

{{{ def collapse_body(self): """Collapse self.body to a single string; replace it and return it.""" newbody = ''.join([chunk for chunk in self.body]) self.body = newbody return newbody }}}

If response.body is a large string, this function generates a lot of heat performing a no-op. An isinstance(self.body, basestring) test could avoid that.

Comments (2)

  1. Log in to comment