summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Radestock <matthias@rabbitmq.com>2011-01-16 17:24:22 +0000
committerMatthias Radestock <matthias@rabbitmq.com>2011-01-16 17:24:22 +0000
commit1d54ecbb1c04218a8ed4986dcd5dd4e0e456a374 (patch)
treeafc4d039f822b702c366a2284b84dffc44da1f48
parent0c51466cf98bd314498b321618f5c3feb57564ac (diff)
downloadrabbitmq-server-1d54ecbb1c04218a8ed4986dcd5dd4e0e456a374.tar.gz
simplifying refactor
-rw-r--r--src/rabbit_msg_store.erl24
1 files changed, 11 insertions, 13 deletions
diff --git a/src/rabbit_msg_store.erl b/src/rabbit_msg_store.erl
index fe5cbab8..0e475825 100644
--- a/src/rabbit_msg_store.erl
+++ b/src/rabbit_msg_store.erl
@@ -1163,22 +1163,20 @@ add_cref_to_guids_if_callback(CRef, Guid, CTG, Clients) ->
gb_sets:singleton(Guid), CTG)
end.
-client_confirm_if_on_disk(CRef, Guid, File,
+client_confirm_if_on_disk(CRef, Guid, CurFile,
State = #msstate { clients = Clients,
current_file = CurFile,
cref_to_guids = CTG }) ->
- CTG1 =
- case File of
- CurFile -> add_cref_to_guids_if_callback(CRef, Guid, CTG, Clients);
- _ -> case dict:fetch(CRef, Clients) of
- {undefined, _CloseFDsFun} ->
- ok;
- {MsgOnDiskFun, _CloseFDsFun} ->
- MsgOnDiskFun(gb_sets:singleton(Guid), written)
- end,
- CTG
- end,
- State #msstate { cref_to_guids = CTG1 }.
+ State #msstate {
+ cref_to_guids = add_cref_to_guids_if_callback(CRef, Guid, CTG, Clients) };
+client_confirm_if_on_disk(CRef, Guid, _File,
+ State = #msstate { clients = Clients }) ->
+ case dict:fetch(CRef, Clients) of
+ {undefined, _CloseFDsFun} -> State;
+ {MsgOnDiskFun, _CloseFDsFun} -> MsgOnDiskFun(gb_sets:singleton(Guid),
+ written),
+ State
+ end.
%% Detect whether the Guid is older or younger than the client's death
%% msg (if there is one). If the msg is older than the client death