aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2015-10-12 15:56:35 +0200
committerBjörn Gustavsson <[email protected]>2015-12-16 15:52:25 +0100
commit93f7c2dcdd36a31dca6bfd06e0784ed715e51f77 (patch)
treebc6347d496303de0ec93f09801a876e3462a73b0
parente1dc0aa4100f881f4350162bd523c53d38f08b8f (diff)
downloadotp-93f7c2dcdd36a31dca6bfd06e0784ed715e51f77.tar.gz
otp-93f7c2dcdd36a31dca6bfd06e0784ed715e51f77.tar.bz2
otp-93f7c2dcdd36a31dca6bfd06e0784ed715e51f77.zip
Remove useless 'catch' in start_it/1
The last clause in start_it/1 calls a function in some module. It goes to great length to catch any exception and pass them on unchanged, and if there was a normal return, it will just return the return value. It can been seen that the entire 'catch' construction with the reference trick is totally unnecessary.
-rw-r--r--erts/preloaded/src/init.erl16
1 files changed, 4 insertions, 12 deletions
diff --git a/erts/preloaded/src/init.erl b/erts/preloaded/src/init.erl
index a85b41fddb..c1c0e781e7 100644
--- a/erts/preloaded/src/init.erl
+++ b/erts/preloaded/src/init.erl
@@ -1046,18 +1046,10 @@ start_it({eval,Bin}) ->
{value, _Value, _Bs} = erl_eval:exprs(Expr, erl_eval:new_bindings()),
ok;
start_it([_|_]=MFA) ->
- Ref = make_ref(),
- case catch {Ref,case MFA of
- [M] -> M:start();
- [M,F] -> M:F();
- [M,F|Args] -> M:F(Args) % Args is a list
- end} of
- {Ref,R} ->
- R;
- {'EXIT',Reason} ->
- exit(Reason);
- Other ->
- throw(Other)
+ case MFA of
+ [M] -> M:start();
+ [M,F] -> M:F();
+ [M,F|Args] -> M:F(Args) % Args is a list
end.
%%