couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kocol...@apache.org
Subject [1/3] couch-mrview commit: updated refs/heads/2724-chunked-buffering to 2f489b9
Date Mon, 20 Jul 2015 20:27:02 GMT
Repository: couchdb-couch-mrview
Updated Branches:
  refs/heads/2724-chunked-buffering [created] 2f489b9cd


Avoid gratuitous list flattening

Mochiweb and gen_tcp are perfectly happy with iolists.


Project: http://git-wip-us.apache.org/repos/asf/couchdb-couch-mrview/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-couch-mrview/commit/4038d9eb
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch-mrview/tree/4038d9eb
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch-mrview/diff/4038d9eb

Branch: refs/heads/2724-chunked-buffering
Commit: 4038d9eb0cb9b1c291fdcfafa5fcd12ad1b85e3c
Parents: b743459
Author: Adam Kocoloski <adam@cloudant.com>
Authored: Mon Jul 20 15:53:18 2015 -0400
Committer: Adam Kocoloski <adam@cloudant.com>
Committed: Mon Jul 20 15:53:18 2015 -0400

----------------------------------------------------------------------
 src/couch_mrview_http.erl | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-couch-mrview/blob/4038d9eb/src/couch_mrview_http.erl
----------------------------------------------------------------------
diff --git a/src/couch_mrview_http.erl b/src/couch_mrview_http.erl
index ccc8dc1..d0da69e 100644
--- a/src/couch_mrview_http.erl
+++ b/src/couch_mrview_http.erl
@@ -343,8 +343,7 @@ view_cb({meta, Meta}, #vacc{resp=Resp}=Acc) ->
         undefined -> [];
         UpdateSeq -> [io_lib:format("\"update_seq\":~p", [UpdateSeq])]
     end ++ ["\"rows\":["],
-    Prepend = prepend_val(Acc),
-    Chunk = lists:flatten(Prepend ++ "{" ++ string:join(Parts, ",") ++ "\r\n"),
+    Chunk = [prepend_val(Acc), "{", string:join(Parts, ","), "\r\n"],
     {ok, Resp1} = chttpd:send_delayed_chunk(Resp, Chunk),
     {ok, Acc#vacc{resp=Resp1, prepend=""}};
 view_cb({row, Row}, Acc) ->


Mime
View raw message