From 10da416c760f1b3c1c6d7d31b9925560200c4bd0 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Tue, 20 Mar 2007 19:50:15 +0000 Subject: [PATCH] fix related to piece priorities --- src/piece_picker.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/piece_picker.cpp b/src/piece_picker.cpp index e976f0dff..9d62a7420 100755 --- a/src/piece_picker.cpp +++ b/src/piece_picker.cpp @@ -546,15 +546,19 @@ namespace libtorrent m_downloads.erase(i); piece_pos& p = m_piece_map[index]; - int priority = p.priority(m_sequenced_download_threshold); + int prev_priority = p.priority(m_sequenced_download_threshold); p.downloading = 0; - if (priority == 0) + int new_priority = p.priority(m_sequenced_download_threshold); + + if (new_priority == prev_priority) return; + + if (prev_priority == 0) { add(index); } else { - move(priority, p.index); + move(prev_priority, p.index); } }