summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Radestock <matthias@rabbitmq.com>2012-11-16 17:43:42 +0000
committerMatthias Radestock <matthias@rabbitmq.com>2012-11-16 17:43:42 +0000
commit3ea53152cc47f3f126aaa7c8683d4a39d7d39062 (patch)
tree34a5acf991a9668f84ff449db7c100f083a2ee31
parent97491563e8d8fb1cac3b6f01b5471b78307bc11e (diff)
downloadrabbitmq-server-3ea53152cc47f3f126aaa7c8683d4a39d7d39062.tar.gz
optimise
this brings perf roughly on par with default
-rw-r--r--src/rabbit_channel.erl6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/rabbit_channel.erl b/src/rabbit_channel.erl
index f8f099f6..6ccc2e65 100644
--- a/src/rabbit_channel.erl
+++ b/src/rabbit_channel.erl
@@ -1360,8 +1360,10 @@ deliver_to_queues({Delivery = #delivery{message = Message = #basic_message{
{QNames1, QMons1} =
lists:foldl(fun (#amqqueue{pid = QPid, name = QName},
{QNames0, QMons0}) ->
- {dict:store(QPid, QName, QNames0),
- pmon:monitor(QPid, QMons0)}
+ {case dict:is_key(QPid, QNames0) of
+ true -> QNames0;
+ false -> dict:store(QPid, QName, QNames0)
+ end, pmon:monitor(QPid, QMons0)}
end, {QNames, pmon:monitor_all(DeliveredQPids, QMons)}, Qs),
State1 = process_routing_result(RoutingRes, DeliveredQPids,
XName, MsgSeqNo, Message,