From d98a441dc4d4eaf1af8cb4b0496885a89c83e0c2 Mon Sep 17 00:00:00 2001 From: noctuum <25441068+noctuum@users.noreply.github.com> Date: Mon, 28 Sep 2026 01:20:27 +0500 Subject: [PATCH] Sort the transfer chunks by index The default comparison ordered the pointers, not the chunk indexes. --- src/display/window_download_chunks_seen.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/display/window_download_chunks_seen.cc b/src/display/window_download_chunks_seen.cc index 88c74c7a..1ee75629 100644 --- a/src/display/window_download_chunks_seen.cc +++ b/src/display/window_download_chunks_seen.cc @@ -57,7 +57,8 @@ WindowDownloadChunksSeen::redraw() { const torrent::TransferList* transfers = m_download->download()->transfer_list(); std::vector transferChunks(transfers->begin(), transfers->end()); - std::sort(transferChunks.begin(), transferChunks.end()); + std::sort(transferChunks.begin(), transferChunks.end(), + [](const auto& left, const auto& right) { return left->index() < right->index(); }); std::vector::const_iterator itrTransfer = transferChunks.begin();