Skip to content

Commit 1e05064

Browse files
committed
Improve comments
1 parent 3d8a364 commit 1e05064

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

deps/rabbit/src/mc_amqp.erl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -474,8 +474,7 @@ convert_from_3_13_msg(#msg{header = H,
474474
amqp_annotations().
475475
protocol_state_message_annotations(MA, Anns) ->
476476
%% To efficiently overwrite MA with Anns, we first remove entries in MA
477-
%% that will be re-added by Anns. We optimise for the common case where no
478-
%% MA entries need to be removed.
477+
%% that will be re-added by Anns.
479478
Fun = fun({{symbol, <<"x-exchange">>}, _}) ->
480479
not maps:is_key(?ANN_EXCHANGE, Anns);
481480
({{symbol, <<"x-routing-key">>}, _}) ->
@@ -491,6 +490,8 @@ protocol_state_message_annotations(MA, Anns) ->
491490
end,
492491
MA1 = case lists:all(Fun, MA) of
493492
true ->
493+
%% We optimise for the common case where no MA entries need to
494+
%% be removed: We avoid the list allocation in lists:filter/2.
494495
MA;
495496
false ->
496497
lists:filter(Fun, MA)

0 commit comments

Comments
 (0)