summaryrefslogtreecommitdiff
path: root/src/couchdb/couch_btree.erl
diff options
context:
space:
mode:
authorDamien F. Katz <damien@apache.org>2008-05-20 19:57:37 +0000
committerDamien F. Katz <damien@apache.org>2008-05-20 19:57:37 +0000
commit5da7c1a8ba70f41a8e92cb1efee1f6c6898a2901 (patch)
treee675679054d39391833d0eafeb7a2a5ebac03286 /src/couchdb/couch_btree.erl
parent2178d96a2f5d2103676d0319c07d1f6bb904b97c (diff)
Fixed design document view definitions to be consistent with temp views. Changed the name of the map(K,V) call in the javascript views to emit(K,V)
git-svn-id: https://svn.apache.org/repos/asf/incubator/couchdb/trunk@658405 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/couchdb/couch_btree.erl')
-rw-r--r--src/couchdb/couch_btree.erl7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/couchdb/couch_btree.erl b/src/couchdb/couch_btree.erl
index 6fd9b0c8..57013ee9 100644
--- a/src/couchdb/couch_btree.erl
+++ b/src/couchdb/couch_btree.erl
@@ -419,7 +419,7 @@ collect_node(Bt, {P, R}, KeyStart, KeyEnd) ->
true -> % got full node, return the already calculated reduction
{[], [{nil, {P, R}}]};
false -> % otherwise return the keyvalues for later reduction
- {KVs2, []}
+ {[assemble(Bt,K,V) || {K,V} <- KVs2], []}
end
end.
@@ -568,9 +568,10 @@ stream_kv_node(Bt, Reds, KVs, StartKey, Dir, Fun, Acc) ->
stream_kv_node2(_Bt, _Reds, _PrevKVs, [], _Dir, _Fun, Acc) ->
{ok, Acc};
stream_kv_node2(Bt, Reds, PrevKVs, [{K,V} | RestKVs], Dir, Fun, Acc) ->
- case Fun(assemble(Bt, K, V), {PrevKVs, Reds}, Acc) of
+ AssembledKV = assemble(Bt, K, V),
+ case Fun(AssembledKV, {PrevKVs, Reds}, Acc) of
{ok, Acc2} ->
- stream_kv_node2(Bt, Reds, [{K,V} | PrevKVs], RestKVs, Dir, Fun, Acc2);
+ stream_kv_node2(Bt, Reds, [AssembledKV | PrevKVs], RestKVs, Dir, Fun, Acc2);
{stop, Acc2} ->
{stop, Acc2}
end.