summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Sackman <matthew@rabbitmq.com>2011-07-18 14:09:24 +0100
committerMatthew Sackman <matthew@rabbitmq.com>2011-07-18 14:09:24 +0100
commitefb66a7e5fe0b0fdd29cb6232e9eac5cb9918504 (patch)
treefb3b0d86f81f4884b0a04f019874ef82f6492e0b
parent8f910d23934c24f01e4199008727ee6c2cf2cb1d (diff)
downloadrabbitmq-server-efb66a7e5fe0b0fdd29cb6232e9eac5cb9918504.tar.gz
appending to a list is slow. And we don't seem to care about this list being ordered
-rw-r--r--src/rabbit_backing_queue_qc.erl12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/rabbit_backing_queue_qc.erl b/src/rabbit_backing_queue_qc.erl
index d616979a..a870ddd5 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;