From 6ae13b5f8b827bc87a8cf3306c3caa1b97e49df3 Mon Sep 17 00:00:00 2001 From: Filipe David Borba Manana Date: Thu, 30 Sep 2010 12:03:15 +0000 Subject: 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 --- src/couchdb/couch_view_group.erl | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/couchdb/couch_view_group.erl') diff --git a/src/couchdb/couch_view_group.erl b/src/couchdb/couch_view_group.erl index 86e41b89..2f59f8e3 100644 --- a/src/couchdb/couch_view_group.erl +++ b/src/couchdb/couch_view_group.erl @@ -519,19 +519,19 @@ get_group_info(State) -> % maybe move to another module design_doc_to_view_group(#doc{id=Id,body={Fields}}) -> - Language = ?getv(<<"language">>, Fields, <<"javascript">>), - {DesignOptions} = ?getv(<<"options">>, Fields, {[]}), - {RawViews} = ?getv(<<"views">>, Fields, {[]}), - Lib = ?getv(<<"lib">>, RawViews, {[]}), + Language = couch_util:get_value(<<"language">>, Fields, <<"javascript">>), + {DesignOptions} = couch_util:get_value(<<"options">>, Fields, {[]}), + {RawViews} = couch_util:get_value(<<"views">>, Fields, {[]}), + Lib = couch_util:get_value(<<"lib">>, RawViews, {[]}), % add the views to a dictionary object, with the map source as the key DictBySrc = lists:foldl( fun({Name, {MRFuns}}, DictBySrcAcc) -> - case ?getv(<<"map">>, MRFuns) of + case couch_util:get_value(<<"map">>, MRFuns) of undefined -> DictBySrcAcc; MapSrc -> - RedSrc = ?getv(<<"reduce">>, MRFuns, null), - {ViewOptions} = ?getv(<<"options">>, MRFuns, {[]}), + RedSrc = couch_util:get_value(<<"reduce">>, MRFuns, null), + {ViewOptions} = couch_util:get_value(<<"options">>, MRFuns, {[]}), View = case dict:find({MapSrc, ViewOptions}, DictBySrcAcc) of {ok, View0} -> View0; @@ -594,7 +594,7 @@ init_group(Db, Fd, #group{def_lang=Lang,views=Views}= {Count, Reduced} end, - case ?getv(<<"collation">>, Options, <<"default">>) of + case couch_util:get_value(<<"collation">>, Options, <<"default">>) of <<"default">> -> Less = fun couch_view:less_json_ids/2; <<"raw">> -> -- cgit v1.2.3