diff options
author | Stavros Aronis <[email protected]> | 2012-02-09 14:55:38 +0100 |
---|---|---|
committer | Henrik Nord <[email protected]> | 2012-05-21 15:31:16 +0200 |
commit | bceee0662a9f6aac6b0987517498bff2ade144df (patch) | |
tree | 57cb56d8e57480a653af12300699015419ef20e3 | |
parent | a1a8c859540dae42ac287a495301f7e6317ff3c3 (diff) | |
download | otp-bceee0662a9f6aac6b0987517498bff2ade144df.tar.gz otp-bceee0662a9f6aac6b0987517498bff2ade144df.tar.bz2 otp-bceee0662a9f6aac6b0987517498bff2ade144df.zip |
Refactoring in plt
-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); |