couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fdman...@apache.org
Subject svn commit: r1058674 - /couchdb/trunk/src/couchdb/couch_httpd.erl
Date Thu, 13 Jan 2011 17:21:34 GMT
Author: fdmanana
Date: Thu Jan 13 17:21:34 2011
New Revision: 1058674

URL: http://svn.apache.org/viewvc?rev=1058674&view=rev
Log:
Avoid unnecessary conversion to binary

Mochiweb accepts IO lists.

Modified:
    couchdb/trunk/src/couchdb/couch_httpd.erl

Modified: couchdb/trunk/src/couchdb/couch_httpd.erl
URL: http://svn.apache.org/viewvc/couchdb/trunk/src/couchdb/couch_httpd.erl?rev=1058674&r1=1058673&r2=1058674&view=diff
==============================================================================
--- couchdb/trunk/src/couchdb/couch_httpd.erl (original)
+++ couchdb/trunk/src/couchdb/couch_httpd.erl Thu Jan 13 17:21:34 2011
@@ -622,9 +622,7 @@ send_json(Req, Code, Headers, Value) ->
         {"Content-Type", negotiate_content_type(Req)},
         {"Cache-Control", "must-revalidate"}
     ],
-    Body = list_to_binary(
-        [start_jsonp(Req), ?JSON_ENCODE(Value), end_jsonp(), $\n]
-    ),
+    Body = [start_jsonp(Req), ?JSON_ENCODE(Value), end_jsonp(), $\n],
     send_response(Req, Code, DefaultHeaders ++ Headers, Body).
 
 start_json_response(Req, Code) ->



Mime
View raw message