From 03a4399d036fda9dd5def39812e23de5d6b5b951 Mon Sep 17 00:00:00 2001 From: Matthias Radestock Date: Fri, 22 Oct 2010 04:11:13 +0100 Subject: small refactor --- src/rabbit_msg_store_gc.erl | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'src/rabbit_msg_store_gc.erl') diff --git a/src/rabbit_msg_store_gc.erl b/src/rabbit_msg_store_gc.erl index cd303f7c..833222f0 100644 --- a/src/rabbit_msg_store_gc.erl +++ b/src/rabbit_msg_store_gc.erl @@ -108,16 +108,15 @@ handle_cast({delete, File}, State) -> handle_cast({no_readers, File}, State = #state { pending_no_readers = Pending }) -> - State1 = case dict:find(File, Pending) of - error -> - State; - {ok, {Action, Files}} -> - attempt_action( - Action, Files, - State #state { pending_no_readers = - dict:erase(File, Pending) }) - end, - {noreply, State1, hibernate}; + {noreply, case dict:find(File, Pending) of + error -> + State; + {ok, {Action, Files}} -> + Pending1 = dict:erase(File, Pending), + attempt_action( + Action, Files, + State #state { pending_no_readers = Pending1 }) + end, hibernate}; handle_cast({set_maximum_since_use, Age}, State) -> ok = file_handle_cache:set_maximum_since_use(Age), -- cgit v1.2.1