summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandru Scvortov <alexandru@rabbitmq.com>2010-10-04 17:17:28 +0100
committerAlexandru Scvortov <alexandru@rabbitmq.com>2010-10-04 17:17:28 +0100
commit4922c67a549b57d89e0ced8d735591e6fd64c8c0 (patch)
tree1ea42247ab5df3b85d3420d78039cd13861938fd
parent44614dcf3a8e651e26e99fe1b7f5176bc90cdd7f (diff)
downloadrabbitmq-server-4922c67a549b57d89e0ced8d735591e6fd64c8c0.tar.gz
refactor
-rw-r--r--src/rabbit_variable_queue.erl15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/rabbit_variable_queue.erl b/src/rabbit_variable_queue.erl
index 86ed4b57..1d6b324d 100644
--- a/src/rabbit_variable_queue.erl
+++ b/src/rabbit_variable_queue.erl
@@ -1170,16 +1170,11 @@ ack(MsgStoreFun, Fun, AckTags, State = #vqstate { pending_ack = PendAck }) ->
pending_ack = dict:erase(SeqId, PA) })}
end, {{[], orddict:new()}, State}, AckTags),
IndexState1 = rabbit_queue_index:ack(SeqIds, IndexState),
- ok = orddict:fold(fun (MsgStore, Guids, ok) ->
- MsgStoreFun(MsgStore, Guids)
- end, ok, GuidsByStore),
- AckdGuids = lists:foldl(
- fun(SeqId, Guids) ->
- [case dict:fetch(SeqId, PendAck) of
- #msg_status { msg = Msg } -> Msg#basic_message.guid;
- {_, Guid} -> Guid
- end | Guids]
- end, [], SeqIds),
+ AckdGuids = lists:concat(
+ orddict:fold(fun (MsgStore, Guids, Gs) ->
+ MsgStoreFun(MsgStore, Guids),
+ [Guids | Gs]
+ end, [], GuidsByStore)),
State2 = remove_confirms(gb_sets:from_list(AckdGuids), State1),
PCount1 = PCount - find_persistent_count(sum_guids_by_store_to_len(
orddict:new(), GuidsByStore)),