File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -474,8 +474,7 @@ convert_from_3_13_msg(#msg{header = H,
474474 amqp_annotations ().
475475protocol_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 )
You can’t perform that action at this time.
0 commit comments