diff options
| author | Matthias Radestock <matthias@rabbitmq.com> | 2010-10-24 16:03:40 +0100 |
|---|---|---|
| committer | Matthias Radestock <matthias@rabbitmq.com> | 2010-10-24 16:03:40 +0100 |
| commit | 5e742b32411b19afd398f27697872775cf721c52 (patch) | |
| tree | c3fae152ea0b4450fbc7eb8e15907ab6d574cdf2 /src | |
| parent | 216d967f6afce95f52316c98a78e0b8b1ce9f458 (diff) | |
| download | rabbitmq-server-git-5e742b32411b19afd398f27697872775cf721c52.tar.gz | |
refactoring: comprehensions are easier to comprehend than folds
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit_variable_queue.erl | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/rabbit_variable_queue.erl b/src/rabbit_variable_queue.erl index 1ac5be7d6c..a1c442d3df 100644 --- a/src/rabbit_variable_queue.erl +++ b/src/rabbit_variable_queue.erl @@ -1013,11 +1013,8 @@ tx_commit_index(State = #vqstate { on_sync = #sync { durable = IsDurable }) -> PAcks = lists:append(SPAcks), Acks = lists:append(SAcks), - Pubs = lists:foldl(fun({Fun, PubsN}, OuterAcc) -> - lists:foldl(fun({Msg, MsgProps}, Acc) -> - [{Msg, Fun(MsgProps)} | Acc] - end, OuterAcc, PubsN) - end, [], SPubs), + Pubs = [{Msg, Fun(MsgProps)} || {Fun, PubsN} <- lists:reverse(SPubs), + {Msg, MsgProps} <- lists:reverse(PubsN)], {SeqIds, State1 = #vqstate { index_state = IndexState }} = lists:foldl( fun ({Msg = #basic_message { is_persistent = IsPersistent }, |
