diff options
| author | Matthew Sackman <matthew@rabbitmq.com> | 2011-01-14 19:05:28 +0000 |
|---|---|---|
| committer | Matthew Sackman <matthew@rabbitmq.com> | 2011-01-14 19:05:28 +0000 |
| commit | 352224998317eef0065da02cbe88b5438487c67c (patch) | |
| tree | 58684cf351da7008ea20f4e74f7a99b5d28f8e32 | |
| parent | c0a367ad8e5a6f8bac8369f5c4703dc56b1fcc73 (diff) | |
| download | rabbitmq-server-git-352224998317eef0065da02cbe88b5438487c67c.tar.gz | |
Rearrangement in gc. Can't seem to get it shorter than this though
| -rw-r--r-- | src/rabbit_msg_store_gc.erl | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/rabbit_msg_store_gc.erl b/src/rabbit_msg_store_gc.erl index 7cf5c1f917..68bf43380e 100644 --- a/src/rabbit_msg_store_gc.erl +++ b/src/rabbit_msg_store_gc.erl @@ -137,16 +137,17 @@ attempt_action(Action, Files, msg_store_state = MsgStoreState }) -> case [File || File <- Files, rabbit_msg_store:has_readers(File, MsgStoreState)] of - [] -> Thunks1 = - [do_action(Action, Files, MsgStoreState) | Thunks], - State #state { on_action = run_thunks(Thunks1) }; - [File | _] -> Pending1 = dict:store(File, {Action, Files}, Pending), - State #state { pending_no_readers = Pending1 } + [] -> + Thunks1 = lists:filter( + fun (Thunk) -> not Thunk() end, + [do_action(Action, Files, MsgStoreState) | Thunks]), + State #state { on_action = Thunks1 }; + [File | _] -> + Pending1 = dict:store(File, {Action, Files}, Pending), + State #state { pending_no_readers = Pending1 } end. do_action(combine, [Source, Destination], MsgStoreState) -> rabbit_msg_store:combine_files(Source, Destination, MsgStoreState); do_action(delete, [File], MsgStoreState) -> rabbit_msg_store:delete_file(File, MsgStoreState). - -run_thunks(Thunks) -> lists:filter(fun (Thunk) -> not Thunk() end, Thunks). |
