diff options
author | Filipe David Borba Manana <fdmanana@apache.org> | 2010-09-30 12:03:15 +0000 |
---|---|---|
committer | Filipe David Borba Manana <fdmanana@apache.org> | 2010-09-30 12:03:15 +0000 |
commit | 6ae13b5f8b827bc87a8cf3306c3caa1b97e49df3 (patch) | |
tree | 9662164348a314705094f5f52456ab7bfe330df9 /src/couchdb/couch_rep_db_listener.erl | |
parent | 1c0a6e9c637fcfec2990c6318b3c69e4c7591d76 (diff) |
Removing ?getv macros.
With OTP releases up to R13B03 it's not possible to define a 2 macro functions with the same name and different arities.
(Only allowed in R13B04 and R14).
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1003025 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/couchdb/couch_rep_db_listener.erl')
-rw-r--r-- | src/couchdb/couch_rep_db_listener.erl | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/couchdb/couch_rep_db_listener.erl b/src/couchdb/couch_rep_db_listener.erl index d2a2978e..926b2987 100644 --- a/src/couchdb/couch_rep_db_listener.erl +++ b/src/couchdb/couch_rep_db_listener.erl @@ -142,7 +142,7 @@ consume_changes(ChangesQueue) -> has_valid_rep_id({Change}) -> - has_valid_rep_id(?getv(<<"id">>, Change)); + has_valid_rep_id(couch_util:get_value(<<"id">>, Change)); has_valid_rep_id(<<?DESIGN_DOC_PREFIX, _Rest/binary>>) -> false; has_valid_rep_id(_Else) -> @@ -150,12 +150,12 @@ has_valid_rep_id(_Else) -> process_change({Change}) -> - {RepProps} = JsonRepDoc = ?getv(doc, Change), - case ?getv(<<"deleted">>, Change, false) of + {RepProps} = JsonRepDoc = couch_util:get_value(doc, Change), + case couch_util:get_value(<<"deleted">>, Change, false) of true -> maybe_stop_replication(JsonRepDoc); false -> - case ?getv(<<"state">>, RepProps) of + case couch_util:get_value(<<"state">>, RepProps) of <<"completed">> -> maybe_stop_replication(JsonRepDoc); <<"error">> -> @@ -164,7 +164,7 @@ process_change({Change}) -> <<"triggered">> -> maybe_start_replication(JsonRepDoc); undefined -> - case ?getv(<<"replication_id">>, RepProps) of + case couch_util:get_value(<<"replication_id">>, RepProps) of undefined -> maybe_start_replication(JsonRepDoc); _ -> @@ -176,13 +176,13 @@ process_change({Change}) -> rep_user_ctx({RepDoc}) -> - case ?getv(<<"user_ctx">>, RepDoc) of + case couch_util:get_value(<<"user_ctx">>, RepDoc) of undefined -> #user_ctx{roles = [<<"_admin">>]}; {UserCtx} -> #user_ctx{ - name = ?getv(<<"name">>, UserCtx, null), - roles = ?getv(<<"roles">>, UserCtx, []) + name = couch_util:get_value(<<"name">>, UserCtx, null), + roles = couch_util:get_value(<<"roles">>, UserCtx, []) } end. @@ -190,7 +190,7 @@ rep_user_ctx({RepDoc}) -> maybe_start_replication({RepProps} = JsonRepDoc) -> UserCtx = rep_user_ctx(JsonRepDoc), RepId = couch_rep:make_replication_id(JsonRepDoc, UserCtx), - DocId = ?getv(<<"_id">>, RepProps), + DocId = couch_util:get_value(<<"_id">>, RepProps), case ets:lookup(?REP_ID_TO_DOC_ID_MAP, RepId) of [] -> true = ets:insert(?REP_ID_TO_DOC_ID_MAP, {RepId, DocId}), @@ -222,7 +222,7 @@ start_replication(RepDoc, RepId, UserCtx) -> maybe_stop_replication({RepProps}) -> - DocId = ?getv(<<"_id">>, RepProps), + DocId = couch_util:get_value(<<"_id">>, RepProps), case ets:lookup(?DOC_TO_REP_ID_MAP, DocId) of [{DocId, RepId}] -> couch_rep:end_replication(RepId), |