diff options
| author | Matthew Sackman <matthew@rabbitmq.com> | 2011-07-18 14:09:24 +0100 |
|---|---|---|
| committer | Matthew Sackman <matthew@rabbitmq.com> | 2011-07-18 14:09:24 +0100 |
| commit | 0b55e974a1889a2fc0e39d3442a5e6030976049f (patch) | |
| tree | fb3b0d86f81f4884b0a04f019874ef82f6492e0b /src | |
| parent | 5cdc3daadb11630dbe8a3c8027435ce158d51520 (diff) | |
| download | rabbitmq-server-git-0b55e974a1889a2fc0e39d3442a5e6030976049f.tar.gz | |
appending to a list is slow. And we don't seem to care about this list being ordered
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit_backing_queue_qc.erl | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/rabbit_backing_queue_qc.erl b/src/rabbit_backing_queue_qc.erl index d616979a5e..a870ddd560 100644 --- a/src/rabbit_backing_queue_qc.erl +++ b/src/rabbit_backing_queue_qc.erl @@ -204,11 +204,11 @@ next_state(S, Res, true -> gb_sets:add(MsgId, Confirms); _ -> Confirms end, - acks = Acks ++ case AckReq of - true -> [{AckTag, {MsgProps, Msg}}]; - false -> [] - end - }; + acks = case AckReq of + true -> [{AckTag, {MsgProps, Msg}} | Acks]; + false -> Acks + end + }; next_state(S, Res, {call, ?BQMOD, fetch, [AckReq, _BQ]}) -> #state{len = Len, messages = Messages, acks = Acks} = S, @@ -222,7 +222,7 @@ next_state(S, Res, {call, ?BQMOD, fetch, [AckReq, _BQ]}) -> {{value, MsgProp_Msg}, M2} -> S2 = S1#state{len = Len - 1, messages = M2}, case AckReq of - true -> S2#state{acks = Acks ++ [{AckTag, MsgProp_Msg}]}; + true -> S2#state{acks = [{AckTag, MsgProp_Msg} | Acks]}; false -> S2 end end; |
