From 44e3142e90d13e20797786ee54a1d851628321f8 Mon Sep 17 00:00:00 2001 From: Brian Cully Date: Sun, 2 Mar 2008 14:36:53 -0500 Subject: Use pattern match, not guard. --- src/mysqlerl_connection.erl | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src') 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}. -- cgit v1.2.3