aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Cully <bjc@kublai.com>2008-03-02 14:36:53 -0500
committerBrian Cully <github.20.shmit@spamgourmet.com>2008-03-02 14:36:53 -0500
commit44e3142e90d13e20797786ee54a1d851628321f8 (patch)
tree166a5f0e4a6d2b6cd192a46507aa9b20734183e8
parent2b13b1cd11c874657f8be82077fda38979e59b59 (diff)
downloadmysqlerl-44e3142e90d13e20797786ee54a1d851628321f8.tar.gz
mysqlerl-44e3142e90d13e20797786ee54a1d851628321f8.zip
Use pattern match, not guard.
-rw-r--r--src/mysqlerl_connection.erl6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/mysqlerl_connection.erl b/src/mysqlerl_connection.erl
index a0b3062..495f841 100644
--- a/src/mysqlerl_connection.erl
+++ b/src/mysqlerl_connection.erl
@@ -54,12 +54,10 @@ handle_call(Request, _From, State) ->
handle_cast(_Request, State) ->
{noreply, State}.
-handle_info({'EXIT', Pid, _Reason}, State)
- when Pid == State#state.owner ->
+handle_info({'EXIT', Pid, _Reason}, #state{owner = Pid} = State) ->
io:format("DEBUG: owner ~p shut down.~n", [Pid]),
{stop, normal, State};
-handle_info({'EXIT', Ref, Reason}, State)
- when Ref == State#state.ref ->
+handle_info({'EXIT', Ref, Reason}, #state{ref = Ref} = State) ->
io:format("DEBUG: Port ~p closed on ~p.~n", [Ref, State]),
{stop, #port_closed{reason = Reason}, State}.