Use erlang:function_exported/3

This commit is contained in:
Tuncer Ayaz 2011-02-21 17:42:10 +01:00
parent c6f6e8a572
commit 3356c2d9e8

View file

@ -280,8 +280,8 @@ expand_lib_dirs([Dir | Rest], Root, Acc) ->
select_modules([], _Command, Acc) -> select_modules([], _Command, Acc) ->
lists:reverse(Acc); lists:reverse(Acc);
select_modules([Module | Rest], Command, Acc) -> select_modules([Module | Rest], Command, Acc) ->
Exports = Module:module_info(exports), {module, Module} = code:ensure_loaded(Module),
case lists:member({Command, 2}, Exports) of case erlang:function_exported(Module, Command, 2) of
true -> true ->
select_modules(Rest, Command, [Module | Acc]); select_modules(Rest, Command, [Module | Acc]);
false -> false ->