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
commit471a7ab4d4ebff003cc96fb6ec1e5c7c6079a3b8 (patch)
tree34a5acf991a9668f84ff449db7c100f083a2ee31
parentece39797579874b9f53ef9829c28b662bcd48b67 (diff)
downloadrabbitmq-server-git-471a7ab4d4ebff003cc96fb6ec1e5c7c6079a3b8.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 f8f099f674..6ccc2e65d2 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,