Re-use the unchanging value of 'Args' rather than including it in every recursive call.
This commit is contained in:
parent
05c8c615ef
commit
6919515de5
1 changed files with 4 additions and 4 deletions
|
@ -22,9 +22,9 @@
|
|||
%% -------------------------------------------------------------------
|
||||
|
||||
-define(ASYNC_NIF_CALL(Fun, Args),
|
||||
F = fun(F, A, T) ->
|
||||
F = fun(F, T) ->
|
||||
R = erlang:make_ref(),
|
||||
case erlang:apply(F, [R|A]) of
|
||||
case erlang:apply(F, [R|Args]) of
|
||||
{ok, enqueued} ->
|
||||
receive
|
||||
{R, {error, shutdown}=Error} ->
|
||||
|
@ -39,9 +39,9 @@
|
|||
{error, eagain} ->
|
||||
SleepyTime = min(30, (T+1)*2),
|
||||
timer:sleep(SleepyTime),
|
||||
F(F, A, SleepyTime);
|
||||
F(F, SleepyTime);
|
||||
Other ->
|
||||
Other
|
||||
end
|
||||
end,
|
||||
F(Fun, Args, 0)).
|
||||
F(Fun, 0)).
|
||||
|
|
Loading…
Reference in a new issue