From b8dc70f27ad5f8fc4ea2901e52590ebbaaaa77a6 Mon Sep 17 00:00:00 2001 From: stickz Date: Sat, 14 Sep 2024 22:49:29 -0400 Subject: [PATCH] Revert "Revert upsert for download wrapper" This reverts commit 7487762d4384883703249c84a72aec96f5a4f10c. --- libtorrent/src/download/download_wrapper.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libtorrent/src/download/download_wrapper.cc b/libtorrent/src/download/download_wrapper.cc index 59e817814..66935491d 100644 --- a/libtorrent/src/download/download_wrapper.cc +++ b/libtorrent/src/download/download_wrapper.cc @@ -225,9 +225,8 @@ DownloadWrapper::receive_hash_done(ChunkHandle handle, const char* hash) { finished_download(); } else if (was_partial && data()->wanted_chunks() == 0) { - priority_queue_erase(&taskScheduler, &m_main->delay_partially_done()); priority_queue_erase(&taskScheduler, &m_main->delay_partially_restarted()); - priority_queue_insert(&taskScheduler, &m_main->delay_partially_done(), cachedTime); + priority_queue_upsert(&taskScheduler, &m_main->delay_partially_done(), cachedTime); } if (!m_main->have_queue()->empty() && m_main->have_queue()->front().first >= cachedTime)