synrc / rt

☀ RT: Erlang Runtime Library
https://rt.n2o.dev
ISC License
8 stars 4 forks source link

[application.erl] redundant case statement #2

Open tank-bohr opened 5 years ago

tank-bohr commented 5 years ago

https://github.com/erlang/otp/blob/34b56e8f566c6f1aa6023bb7b4096b8f2d709d9e/lib/kernel/src/application.erl#L229-L233

Should be moved to function guard

permit(_Application, Bool) when !is_boolean(Bool)
    exit({badarg, {?MODULE, permit, [Application, Bad]}});
permit(Application, Bool)
   ...

And we can do even better

permit(_Application, Bool) when is_boolean(Bool)
    ...
5HT commented 5 years ago

Here we need to rewrite entire dist_ac module with our own QUIC based distribution protocol!