diff options
author | Björn Gustavsson <[email protected]> | 2011-10-27 10:20:21 +0200 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2011-11-29 14:08:40 +0100 |
commit | ea35b304297f28721a0990c2421b935399623b7f (patch) | |
tree | 98284c643ff73b33db0fc37ff414c0d3613622e0 | |
parent | 7c9e0e4b16019a1606df57919bda3b568afe4cef (diff) | |
download | otp-ea35b304297f28721a0990c2421b935399623b7f.tar.gz otp-ea35b304297f28721a0990c2421b935399623b7f.tar.bz2 otp-ea35b304297f28721a0990c2421b935399623b7f.zip |
fprof: Eliminate use of tuple fun
-rw-r--r-- | lib/tools/src/fprof.erl | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/tools/src/fprof.erl b/lib/tools/src/fprof.erl index 155965a65a..1d85a55bd7 100644 --- a/lib/tools/src/fprof.erl +++ b/lib/tools/src/fprof.erl @@ -87,8 +87,10 @@ dbg(_, _, _) -> -apply({M, F} = Function, Args) +apply({M, F}, Args) when is_atom(M), is_atom(F), is_list(Args) -> + Arity = length(Args), + Function = fun M:F/Arity, apply_1(Function, Args, []); apply(Fun, Args) when is_function(Fun), is_list(Args) -> @@ -98,8 +100,10 @@ apply(A, B) -> apply(M, F, Args) when is_atom(M), is_atom(F), is_list(Args) -> apply_1({M, F}, Args, []); -apply({M, F} = Function, Args, Options) +apply({M, F}, Args, Options) when is_atom(M), is_atom(F), is_list(Args), is_list(Options) -> + Arity = length(Args), + Function = fun M:F/Arity, apply_1(Function, Args, Options); apply(Fun, Args, Options) when is_function(Fun), is_list(Args), is_list(Options) -> @@ -109,7 +113,9 @@ apply(A, B, C) -> apply(Module, Function, Args, Options) when is_atom(Module), is_atom(Function), is_list(Args), is_list(Options) -> - apply_1({Module, Function}, Args, Options); + Arity = length(Args), + Fun = fun Module:Function/Arity, + apply_1(Fun, Args, Options); apply(A, B, C, D) -> erlang:error(badarg, [A, B, C, D]). |