Skip to content

Commit 3057fbc

Browse files
ansdmergify[bot]
authored andcommitted
Avoid list allocation
This is simmilar to #14056. The performance benefit is probably negligbile though since this is called only after each batch of Ra commands. Nevertheless, it's unnecessary to allocate a list with 3 elements and therefore 6 words on the heap, so let's optimise it. (cherry picked from commit 2ca4766)
1 parent 329d6f5 commit 3057fbc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

deps/rabbit/src/rabbit_fifo.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2806,7 +2806,7 @@ smallest_raft_index(#?STATE{messages = Messages,
28062806
SmallestDlxRaIdx = rabbit_fifo_dlx:smallest_raft_index(DlxState),
28072807
SmallestMsgsRaIdx = rabbit_fifo_q:get_lowest_index(Messages),
28082808
SmallestRaIdx = rabbit_fifo_index:smallest(Indexes),
2809-
lists:min([SmallestDlxRaIdx, SmallestMsgsRaIdx, SmallestRaIdx]).
2809+
min(min(SmallestDlxRaIdx, SmallestMsgsRaIdx), SmallestRaIdx).
28102810

28112811
make_requeue(ConsumerKey, Notify, [{MsgId, Idx, Header, Msg}], Acc) ->
28122812
lists:reverse([{append,

0 commit comments

Comments
 (0)