aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorLuca Favatella <[email protected]>2014-06-17 22:44:01 +0100
committerBruce Yinhe <[email protected]>2014-07-02 14:57:24 +0200
commitd78e98eeb00fbb250385e1aa99c23a74e5baed86 (patch)
tree90a1f68650fdf5dac4feac3f8cb70700ec8a9534 /lib
parent98c5cdbe60b6d743ad461b651a586c6f3a502ba9 (diff)
downloadotp-d78e98eeb00fbb250385e1aa99c23a74e5baed86.tar.gz
otp-d78e98eeb00fbb250385e1aa99c23a74e5baed86.tar.bz2
otp-d78e98eeb00fbb250385e1aa99c23a74e5baed86.zip
Refactor function in eunit using is_function/2
is_function/2 looks present since at least OTP R13B03, so the change shall not undermine running eunit on older versions of Erlang. This commit is only refactoring - it contains no functional changes.
Diffstat (limited to 'lib')
-rw-r--r--lib/eunit/src/eunit_data.erl9
1 files changed, 2 insertions, 7 deletions
diff --git a/lib/eunit/src/eunit_data.erl b/lib/eunit/src/eunit_data.erl
index 0350f9bf6e..cbbc6fbc15 100644
--- a/lib/eunit/src/eunit_data.erl
+++ b/lib/eunit/src/eunit_data.erl
@@ -440,13 +440,8 @@ parse_function({M, F}) when is_atom(M), is_atom(F) ->
parse_function(F) ->
bad_test(F).
-check_arity(F, N, T) when is_function(F) ->
- case erlang:fun_info(F, arity) of
- {arity, N} ->
- ok;
- _ ->
- bad_test(T)
- end;
+check_arity(F, N, _) when is_function(F, N) ->
+ ok;
check_arity(_, _, T) ->
bad_test(T).