diff options
-rw-r--r-- | lib/dialyzer/src/dialyzer_plt.erl | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/dialyzer/src/dialyzer_plt.erl b/lib/dialyzer/src/dialyzer_plt.erl index 06eaadad9c..c973762df1 100644 --- a/lib/dialyzer/src/dialyzer_plt.erl +++ b/lib/dialyzer/src/dialyzer_plt.erl @@ -156,12 +156,7 @@ lookup_contract(#plt{contracts = Contracts}, [{mfa(), {{Filename::string(), Line::pos_integer()}, #contract{}}}]. lookup_callbacks(#plt{callbacks = Callbacks}, Mod) when is_atom(Mod) -> - FunModFilter = - fun({M, _F, _A}, _Val) -> M =:= Mod; - ( _Key, _Val) -> false - end, - ModCallbacks = dict:filter(FunModFilter, Callbacks), - dict:to_list(ModCallbacks). + table_filter_module(Callbacks, Mod). -type ret_args_types() :: {erl_types:erl_type(), [erl_types:erl_type()]}. @@ -608,6 +603,14 @@ table_lookup_module(Plt, Mod) -> false -> {value, List} end. +table_filter_module(Plt, Mod) -> + FunModFilter = + fun({M, _F, _A}, _Val) -> M =:= Mod; + ( _Key, _Val) -> false + end, + ModCallbacks = dict:filter(FunModFilter, Plt), + dict:to_list(ModCallbacks). + table_all_modules(Plt) -> Fold = fun({M, _F, _A}, _Val, Acc) -> sets:add_element(M, Acc); |