Merge pull request #14088 from rabbitmq/rabbit_fifo_min

Avoid list allocation
This commit is contained in:
Michael Klishin 2025-06-17 12:50:47 +04:00 committed by GitHub
commit b8a9cf12c5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -2806,7 +2806,7 @@ smallest_raft_index(#?STATE{messages = Messages,
SmallestDlxRaIdx = rabbit_fifo_dlx:smallest_raft_index(DlxState), SmallestDlxRaIdx = rabbit_fifo_dlx:smallest_raft_index(DlxState),
SmallestMsgsRaIdx = rabbit_fifo_q:get_lowest_index(Messages), SmallestMsgsRaIdx = rabbit_fifo_q:get_lowest_index(Messages),
SmallestRaIdx = rabbit_fifo_index:smallest(Indexes), SmallestRaIdx = rabbit_fifo_index:smallest(Indexes),
lists:min([SmallestDlxRaIdx, SmallestMsgsRaIdx, SmallestRaIdx]). min(min(SmallestDlxRaIdx, SmallestMsgsRaIdx), SmallestRaIdx).
make_requeue(ConsumerKey, Notify, [{MsgId, Idx, Header, Msg}], Acc) -> make_requeue(ConsumerKey, Notify, [{MsgId, Idx, Header, Msg}], Acc) ->
lists:reverse([{append, lists:reverse([{append,