summaryrefslogtreecommitdiff
path: root/src/couchdb/couch_rep_changes_feed.erl
diff options
context:
space:
mode:
authorFilipe David Borba Manana <fdmanana@apache.org>2010-09-27 19:14:37 +0000
committerFilipe David Borba Manana <fdmanana@apache.org>2010-09-27 19:14:37 +0000
commit6c6db011c2064597526c6f36878a282238dd2bf2 (patch)
tree9875a3237a385b3ff9d9f53be7642bafbabcbbfa /src/couchdb/couch_rep_changes_feed.erl
parentc4e2e1416bcedbe654d56c3851a0d08cddfc4bee (diff)
Replacing calls to couch_util:get_value with ?getv
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1001879 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/couchdb/couch_rep_changes_feed.erl')
-rw-r--r--src/couchdb/couch_rep_changes_feed.erl30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/couchdb/couch_rep_changes_feed.erl b/src/couchdb/couch_rep_changes_feed.erl
index 7f7d3a38..773a2ced 100644
--- a/src/couchdb/couch_rep_changes_feed.erl
+++ b/src/couchdb/couch_rep_changes_feed.erl
@@ -48,7 +48,7 @@ stop(Server) ->
init([Parent, #http_db{}=Source, Since, PostProps]) ->
process_flag(trap_exit, true),
- Feed = case couch_util:get_value(<<"continuous">>, PostProps, false) of
+ Feed = case ?getv(<<"continuous">>, PostProps, false) of
false ->
normal;
true ->
@@ -60,11 +60,11 @@ init([Parent, #http_db{}=Source, Since, PostProps]) ->
{"since", Since},
{"feed", Feed}
],
- QS = case couch_util:get_value(<<"filter">>, PostProps) of
+ QS = case ?getv(<<"filter">>, PostProps) of
undefined ->
BaseQS;
FilterName ->
- {Params} = couch_util:get_value(<<"query_params">>, PostProps, {[]}),
+ {Params} = ?getv(<<"query_params">>, PostProps, {[]}),
lists:foldr(
fun({K, V}, QSAcc) ->
Ks = couch_util:to_list(K),
@@ -126,8 +126,8 @@ init([_Parent, Source, Since, PostProps] = InitArgs) ->
ChangesArgs = #changes_args{
style = all_docs,
since = Since,
- filter = ?b2l(couch_util:get_value(<<"filter">>, PostProps, <<>>)),
- feed = case couch_util:get_value(<<"continuous">>, PostProps, false) of
+ filter = ?b2l(?getv(<<"filter">>, PostProps, <<>>)),
+ feed = case ?getv(<<"continuous">>, PostProps, false) of
true ->
"continuous";
false ->
@@ -150,11 +150,11 @@ init([_Parent, Source, Since, PostProps] = InitArgs) ->
{ok, #state{changes_loop=ChangesPid, init_args=InitArgs}}.
filter_json_req(Db, PostProps) ->
- case couch_util:get_value(<<"filter">>, PostProps) of
+ case ?getv(<<"filter">>, PostProps) of
undefined ->
{[]};
FilterName ->
- {Query} = couch_util:get_value(<<"query_params">>, PostProps, {[]}),
+ {Query} = ?getv(<<"query_params">>, PostProps, {[]}),
{ok, Info} = couch_db:get_db_info(Db),
% simulate a request to db_name/_changes
{[
@@ -307,7 +307,7 @@ handle_messages([Chunk|Rest], State) ->
#state{reply_to=nil} ->
State#state{
count = Count+1,
- last_seq = couch_util:get_value(<<"seq">>, Props),
+ last_seq = ?getv(<<"seq">>, Props),
partial_chunk = <<>>,
rows=queue:in(Row,Rows)
};
@@ -354,16 +354,16 @@ by_seq_loop(Server, Source, StartSeq) ->
qs = [{limit, 1000}, {startkey, StartSeq}]
},
{Results} = couch_rep_httpc:request(Req),
- Rows = couch_util:get_value(<<"rows">>, Results),
+ Rows = ?getv(<<"rows">>, Results),
if Rows =:= [] -> exit(normal); true -> ok end,
EndSeq = lists:foldl(fun({RowInfoList}, _) ->
- Id = couch_util:get_value(<<"id">>, RowInfoList),
- Seq = couch_util:get_value(<<"key">>, RowInfoList),
- {RowProps} = couch_util:get_value(<<"value">>, RowInfoList),
+ Id = ?getv(<<"id">>, RowInfoList),
+ Seq = ?getv(<<"key">>, RowInfoList),
+ {RowProps} = ?getv(<<"value">>, RowInfoList),
RawRevs = [
- couch_util:get_value(<<"rev">>, RowProps),
- couch_util:get_value(<<"conflicts">>, RowProps, []),
- couch_util:get_value(<<"deleted_conflicts">>, RowProps, [])
+ ?getv(<<"rev">>, RowProps),
+ ?getv(<<"conflicts">>, RowProps, []),
+ ?getv(<<"deleted_conflicts">>, RowProps, [])
],
ParsedRevs = couch_doc:parse_revs(lists:flatten(RawRevs)),
Change = {[