diff options
| author | Matthias Radestock <matthias@rabbitmq.com> | 2012-03-23 19:14:58 +0000 |
|---|---|---|
| committer | Matthias Radestock <matthias@rabbitmq.com> | 2012-03-23 19:14:58 +0000 |
| commit | efc555659702b3b9ff858bd119a1fd78d476a225 (patch) | |
| tree | a1ba747c8bd9d367837959a040229ffdf7c4fd0c | |
| parent | fc853e94a462b75dad5d90456c1ba03b71865c9a (diff) | |
| download | rabbitmq-server-git-efc555659702b3b9ff858bd119a1fd78d476a225.tar.gz | |
refactor/optimise 'reject'
| -rw-r--r-- | src/rabbit_amqqueue_process.erl | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/rabbit_amqqueue_process.erl b/src/rabbit_amqqueue_process.erl index 613c11daa1..1bd8ccb712 100644 --- a/src/rabbit_amqqueue_process.erl +++ b/src/rabbit_amqqueue_process.erl @@ -1282,14 +1282,14 @@ handle_cast({ack, AckTags, ChPid}, State) -> handle_cast({reject, AckTags, Requeue, ChPid}, State) -> noreply(subtract_acks( ChPid, AckTags, State, - fun (State1 = #q{backing_queue = BQ, - backing_queue_state = BQS}) -> - case Requeue of - true -> requeue_and_run(AckTags, State1); - false -> Fun = dead_letter_fun(rejected, State), + case Requeue of + true -> fun (State1) -> requeue_and_run(AckTags, State1) end; + false -> Fun = dead_letter_fun(rejected, State), + fun (State1 = #q{backing_queue = BQ, + backing_queue_state = BQS}) -> BQS1 = BQ:fold(Fun, BQS, AckTags), State1#q{backing_queue_state = BQS1} - end + end end)); handle_cast(delete_immediately, State) -> |
