diff options
author | Damien F. Katz <damien@apache.org> | 2009-09-11 23:23:07 +0000 |
---|---|---|
committer | Damien F. Katz <damien@apache.org> | 2009-09-11 23:23:07 +0000 |
commit | 45796298231349dadf650e9ddefd7a6ff32e1302 (patch) | |
tree | 4de5543e9584a2c8a91f0b27b5b8f9e43de3fe46 /src/couchdb/couch_httpd_show.erl | |
parent | 773a23353b9101620ebb91183cb67240c17aa2c9 (diff) |
Refactoring of endkey code in views and btrees. End key functionaility is now handled inside the btree code, simplfying calling code and making it trivial to add new collation options
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@814078 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/couchdb/couch_httpd_show.erl')
-rw-r--r-- | src/couchdb/couch_httpd_show.erl | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/couchdb/couch_httpd_show.erl b/src/couchdb/couch_httpd_show.erl index 86eba4c2..176a9b15 100644 --- a/src/couchdb/couch_httpd_show.erl +++ b/src/couchdb/couch_httpd_show.erl @@ -193,8 +193,8 @@ output_map_list(#httpd{mochi_req=MReq, user_ctx=UserCtx}=Req, Lang, ListSrc, Vie start_response = StartListRespFun, send_row = SendListRowFun }), - FoldAccInit = {Limit, SkipCount, undefined, [], nil}, - {ok, FoldResult} = couch_view:fold(View, Start, Dir, FoldlFun, FoldAccInit), + FoldAccInit = {Limit, SkipCount, undefined, []}, + {ok, _, FoldResult} = couch_view:fold(View, FoldlFun, FoldAccInit, [{start_key, Start},{dir, Dir}]), finish_list(Req, QueryServer, CurrentEtag, FoldResult, StartListRespFun, RowCount) end); @@ -218,9 +218,9 @@ output_map_list(#httpd{mochi_req=MReq, user_ctx=UserCtx}=Req, Lang, ListSrc, Vie StartListRespFun = make_map_start_resp_fun(QueryServer, Db), SendListRowFun = make_map_send_row_fun(QueryServer), - FoldAccInit = {Limit, SkipCount, undefined, [], nil}, - {ok, FoldResult} = lists:foldl( - fun(Key, {ok, FoldAcc}) -> + FoldAccInit = {Limit, SkipCount, undefined, []}, + {ok, _, FoldResult} = lists:foldl( + fun(Key, {ok, _, FoldAcc}) -> FoldlFun = couch_httpd_view:make_view_fold_fun(Req, QueryArgs#view_query_args{ start_key = Key, end_key = Key @@ -230,8 +230,8 @@ output_map_list(#httpd{mochi_req=MReq, user_ctx=UserCtx}=Req, Lang, ListSrc, Vie start_response = StartListRespFun, send_row = SendListRowFun }), - couch_view:fold(View, {Key, StartDocId}, Dir, FoldlFun, FoldAcc) - end, {ok, FoldAccInit}, Keys), + couch_view:fold(View, FoldlFun, FoldAcc, [{start_key, {Key, StartDocId}}, {dir, Dir}]) + end, {ok, nil, FoldAccInit}, Keys), finish_list(Req, QueryServer, CurrentEtag, FoldResult, StartListRespFun, RowCount) end). |