diff options
| author | Matthias Radestock <matthias@rabbitmq.com> | 2013-01-05 23:47:50 +0000 |
|---|---|---|
| committer | Matthias Radestock <matthias@rabbitmq.com> | 2013-01-05 23:47:50 +0000 |
| commit | 6081ccf5a9b438f9dd3d0bd478dc2facb79348e9 (patch) | |
| tree | 5460c7d7206fc52c71f67ac55e9ff6d8d6fc737c | |
| parent | ee0e699acdd21895d3d319d9d50be3059884852d (diff) | |
| download | rabbitmq-server-git-6081ccf5a9b438f9dd3d0bd478dc2facb79348e9.tar.gz | |
optimise rabbit_amqqueue:qpids/1 common case
| -rw-r--r-- | src/rabbit_amqqueue.erl | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/rabbit_amqqueue.erl b/src/rabbit_amqqueue.erl index fbe146e8ed..1ec89c6308 100644 --- a/src/rabbit_amqqueue.erl +++ b/src/rabbit_amqqueue.erl @@ -678,6 +678,8 @@ deliver(Qs, Delivery, _Flow) -> R -> {routed, [QPid || {QPid, ok} <- R]} end. +qpids([]) -> {[], []}; %% optimisation +qpids([#amqqueue{pid = QPid, slave_pids = SPids}]) -> {[QPid], SPids}; %% opt qpids(Qs) -> {MPids, SPids} = lists:foldl(fun (#amqqueue{pid = QPid, slave_pids = SPids}, {MPidAcc, SPidAcc}) -> |
