diff options
author | Simon MacMullen <simon@rabbitmq.com> | 2011-11-02 12:41:38 +0000 |
---|---|---|
committer | Simon MacMullen <simon@rabbitmq.com> | 2011-11-02 12:41:38 +0000 |
commit | ce14a6f69aaf16c0ed4d17f2d6f6eb3d8873daa7 (patch) | |
tree | 793beb78f24201c38ae31a1cab0033b274d901eb | |
parent | 4f379f9953342acece88c552e0f0e05695dd1935 (diff) | |
download | rabbitmq-server-ce14a6f69aaf16c0ed4d17f2d6f6eb3d8873daa7.tar.gz |
Refactor: don't use a dict when a list will do.
-rw-r--r-- | src/supervisor2.erl | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/supervisor2.erl b/src/supervisor2.erl index 0e7b71b2..931a408f 100644 --- a/src/supervisor2.erl +++ b/src/supervisor2.erl @@ -675,8 +675,8 @@ terminate_simple_children(Child, Dynamics, SupName) -> {{error, Reason}, Timedout} end end, - {dict:append(Pid, Reply, Replies), Timedout1} - end, {dict:new(), false}, Pids), + {[{Pid, Reply} | Replies], Timedout1} + end, {[], false}, Pids), timer:cancel(TRef), receive {timeout, Ref} -> ok @@ -684,11 +684,13 @@ terminate_simple_children(Child, Dynamics, SupName) -> 0 -> ok end, ReportError = shutdown_error_reporter(SupName), - dict:map(fun (_Pid, ok) -> ok; - (Pid, {error, R}) -> ReportError(R, Child#child{pid = Pid}) - end, Replies), + [case Reply of + {_Pid, ok} -> ok; + {Pid, {error, R}} -> ReportError(R, Child#child{pid = Pid}) + end || Reply <- Replies], ok. + child_exit_reason(#child{shutdown = brutal_kill}) -> kill; child_exit_reason(#child{}) -> shutdown. |