refactor: micro optimization

This commit is contained in:
Zaiming (Stone) Shi 2024-01-30 15:38:48 +01:00
parent 5bc67cb288
commit 53c217c383
1 changed files with 5 additions and 5 deletions

View File

@ -85,13 +85,13 @@
%% Guards %% Guards
-define(IS_SUBID(Id), (is_binary(Id) orelse is_atom(Id))). -define(IS_SUBID(Id), (is_binary(Id) orelse is_atom(Id))).
-define(cast_or_eval(Pid, Msg, Expr), -define(cast_or_eval(PICK, Msg, Expr),
case Pid =:= self() of case PICK of
true -> __X_Pid when __X_Pid =:= self() ->
_ = Expr, _ = Expr,
ok; ok;
false -> __X_Pid ->
cast(Pid, Msg) cast(__X_Pid, Msg)
end end
). ).