added asserts to the piece picker

This commit is contained in:
Arvid Norberg 2007-03-28 23:23:07 +00:00
parent 513d388c2c
commit ceadb93097
1 changed files with 10 additions and 0 deletions

View File

@ -660,6 +660,10 @@ namespace libtorrent
assert(i != m_downloads.end());
m_downloads.erase(i);
p.downloading = 0;
assert(std::find_if(m_downloads.begin(),
m_downloads.end(),
has_index(index)) == m_downloads.end());
}
assert(p.priority(m_sequenced_download_threshold) == 0);
move(priority, info_index);
@ -696,6 +700,9 @@ namespace libtorrent
has_index(index));
assert(i != m_downloads.end());
m_downloads.erase(i);
assert(std::find_if(m_downloads.begin(),
m_downloads.end(),
has_index(index)) == m_downloads.end());
}
p.downloading = 0;
}
@ -1153,6 +1160,9 @@ namespace libtorrent
int prio = p.priority(m_sequenced_download_threshold);
p.downloading = 0;
move(prio, p.index);
assert(std::find_if(m_downloads.begin(),
m_downloads.end(), has_index(p.index)) == m_downloads.end());
}
}