summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmile Joubert <emile@rabbitmq.com>2011-12-01 16:50:15 +0000
committerEmile Joubert <emile@rabbitmq.com>2011-12-01 16:50:15 +0000
commite8c7a36fdbe6857e9808191e152c65ff61d96a69 (patch)
tree2fc1240b82c9e0e1651fe138b2260e593ec231b3
parent79a2e2da9bfc918f48b7e6ed92f1f573c4afae8a (diff)
downloadrabbitmq-server-e8c7a36fdbe6857e9808191e152c65ff61d96a69.tar.gz
Foster agreement on type of msg_id_to_channel
-rw-r--r--src/rabbit_mirror_queue_slave.erl8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/rabbit_mirror_queue_slave.erl b/src/rabbit_mirror_queue_slave.erl
index 73eaed14..393bd2da 100644
--- a/src/rabbit_mirror_queue_slave.erl
+++ b/src/rabbit_mirror_queue_slave.erl
@@ -526,9 +526,11 @@ promote_me(From, #state { q = Q = #amqqueue { name = QName },
MasterState = rabbit_mirror_queue_master:promote_backing_queue_state(
CPid, BQ, BQS, GM, SS, MonitoringPids),
- MTC = dict:from_list(
- [{MsgId, {ChPid, MsgSeqNo}} ||
- {MsgId, {published, ChPid, MsgSeqNo}} <- dict:to_list(MS)]),
+ MTC = lists:foldl(fun ({MsgId, {published, ChPid, MsgSeqNo}}, MTC0) ->
+ gb_trees:insert(MsgId, {ChPid, MsgSeqNo}, MTC0);
+ (_, MTC0) ->
+ MTC0
+ end, gb_trees:empty(), MSList),
NumAckTags = [NumAckTag || {_MsgId, NumAckTag} <- dict:to_list(MA)],
AckTags = [AckTag || {_Num, AckTag} <- lists:sort(NumAckTags)],
Deliveries = [Delivery || {_ChPid, {PubQ, _PendCh}} <- dict:to_list(SQ),