diff options
| author | Matthew Sackman <matthew@rabbitmq.com> | 2010-07-19 12:20:19 +0100 |
|---|---|---|
| committer | Matthew Sackman <matthew@rabbitmq.com> | 2010-07-19 12:20:19 +0100 |
| commit | c2c3e4325f29665adcfa642f08c8c8746760459c (patch) | |
| tree | 75204e4ec4c9694fff1e8b57388c957e29191d83 | |
| parent | 0cc7ae93dd082685c2bd9dd8101b01193454c19f (diff) | |
| download | rabbitmq-server-git-c2c3e4325f29665adcfa642f08c8c8746760459c.tar.gz | |
dict:find -> dict:fetch andalso lists:flatten -> lists:append
| -rw-r--r-- | src/rabbit_variable_queue.erl | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/rabbit_variable_queue.erl b/src/rabbit_variable_queue.erl index 7e960fde42..a2c3c1001a 100644 --- a/src/rabbit_variable_queue.erl +++ b/src/rabbit_variable_queue.erl @@ -555,13 +555,13 @@ tx_rollback(Txn, State = #vqstate { durable = IsDurable }) -> persistent_guids(Pubs)); false -> ok end, - {lists:flatten(AckTags), a(State)}. + {lists:append(AckTags), a(State)}. tx_commit(Txn, Fun, State = #vqstate { durable = IsDurable }) -> #tx { pending_acks = AckTags, pending_messages = Pubs } = lookup_tx(Txn), erase_tx(Txn), PubsOrdered = lists:reverse(Pubs), - AckTags1 = lists:flatten(AckTags), + AckTags1 = lists:append(AckTags), PersistentGuids = persistent_guids(PubsOrdered), HasPersistentPubs = PersistentGuids =/= [], {AckTags1, @@ -859,9 +859,9 @@ tx_commit_post_msg_store(HasPersistentPubs, Pubs, AckTags, Fun, PersistentAcks = case IsDurable of true -> [AckTag || AckTag <- AckTags, - case dict:find(AckTag, PA) of - {ok, #msg_status {}} -> false; - {ok, {IsPersistent, _Guid}} -> IsPersistent + case dict:fetch(AckTag, PA) of + #msg_status {} -> false; + {IsPersistent, _Guid} -> IsPersistent end]; false -> [] end, @@ -888,9 +888,9 @@ tx_commit_index(State = #vqstate { on_sync = #sync { pubs = SPubs, funs = SFuns }, durable = IsDurable }) -> - PAcks = lists:flatten(SPAcks), - Acks = lists:flatten(SAcks), - Pubs = lists:flatten(lists:reverse(SPubs)), + PAcks = lists:append(SPAcks), + Acks = lists:append(SAcks), + Pubs = lists:append(lists:reverse(SPubs)), {SeqIds, State1 = #vqstate { index_state = IndexState }} = lists:foldl( fun (Msg = #basic_message { is_persistent = IsPersistent }, |
