couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kxepal <...@git.apache.org>
Subject [GitHub] couchdb-couch pull request: Add couch_util:validate_callback_exist...
Date Wed, 25 Feb 2015 00:10:59 GMT
Github user kxepal commented on a diff in the pull request:

    https://github.com/apache/couchdb-couch/pull/37#discussion_r25307182
  
    --- Diff: src/couch_util.erl ---
    @@ -537,3 +538,34 @@ match_rest_of_prefix([{Pos, _Len} | Rest], Prefix, Data, PrefixLength,
N) ->
             {_Pos, _Len1} ->
                 {partial, N + Pos}
         end.
    +
    +callback_exists(Module, Function, Arity) ->
    +    case ensure_loaded(Module) of
    +    true ->
    +        InfoList = Module:module_info(exports),
    +        lists:any(fun(E) -> E == {Function, Arity} end, InfoList);
    --- End diff --
    
    It looks like you really want to use `lists:member/2` here (;


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message