summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Watson <tim@rabbitmq.com>2012-12-05 12:14:19 +0000
committerTim Watson <tim@rabbitmq.com>2012-12-05 12:14:19 +0000
commit8884581308663f55aad4cc9a1097e2c3d1b4de27 (patch)
treeaf45496882fcbccec9182f9e5896521b161dd7ff
parentb7c99598c9abdeaf46b15461796ac5f8abd9c9e4 (diff)
downloadrabbitmq-server-git-8884581308663f55aad4cc9a1097e2c3d1b4de27.tar.gz
reduce distance to OTP - pattern match in case, not-found is always 'false'
-rw-r--r--src/supervisor2.erl5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/supervisor2.erl b/src/supervisor2.erl
index 36d0073257..8d6eaa371c 100644
--- a/src/supervisor2.erl
+++ b/src/supervisor2.erl
@@ -834,10 +834,9 @@ restart_child(Pid, Reason, State) ->
Children = State#state.children,
%% we still support >= R12-B3 in which lists:keyfind/3 doesn't exist
case lists:keysearch(Pid, #child.pid, Children) of
- {value, Child} ->
- RestartType = Child#child.restart_type,
+ {value, #child{restart_type = RestartType} = Child} ->
do_restart(RestartType, Reason, Child, State);
- _ ->
+ false ->
{ok, State}
end.