Make step code more explicit
This change has no semantic effect, only makes the code easier to read
This commit is contained in:
parent
18c197d959
commit
d6b8491a3d
1 changed files with 11 additions and 6 deletions
|
@ -577,18 +577,23 @@ do_step(StepFrom, HowMuch, State) ->
|
|||
DelegateRef = plain_rpc:send_call(Next, {step, DelegateWork})
|
||||
end,
|
||||
|
||||
if (State#state.merge_pid == undefined)
|
||||
orelse (WorkToDoHere =< 0) ->
|
||||
MergeRef = undefined;
|
||||
true ->
|
||||
if WorkToDoHere > 0 ->
|
||||
MergePID = State#state.merge_pid,
|
||||
MergeRef = monitor(process, MergePID),
|
||||
MergePID ! {step, {self(), MergeRef}, WorkToDoHere}
|
||||
MergePID ! {step, {self(), MergeRef}, WorkToDoHere};
|
||||
true ->
|
||||
MergeRef = undefined
|
||||
end,
|
||||
|
||||
if (Next =:= undefined) andalso (MergeRef =:= undefined) ->
|
||||
if (DelegateRef =:= undefined) andalso (MergeRef =:= undefined) ->
|
||||
%% nothing to do ... just return OK
|
||||
|
||||
if (DelegateWork > 0) ->
|
||||
?log("undone work: ~p", [DelegateWork]);
|
||||
true ->
|
||||
ok
|
||||
end,
|
||||
|
||||
State2 = reply_step_ok(State#state { step_caller = StepFrom }),
|
||||
main_loop(State2);
|
||||
true ->
|
||||
|
|
Loading…
Reference in a new issue