optimized away torrent::m_have_pieces (#62) and added some documentation on bitfield. The piece picker is now constructed with the torrent, but still freed when turned into a seed
This commit is contained in:
@@ -326,15 +326,19 @@ namespace libtorrent
|
||||
TORRENT_ASSERT(t);
|
||||
|
||||
bool interested = false;
|
||||
bitfield const& we_have = t->pieces();
|
||||
for (int j = 0; j != (int)we_have.size(); ++j)
|
||||
if (!t->is_finished())
|
||||
{
|
||||
if (!we_have[j]
|
||||
&& t->piece_priority(j) > 0
|
||||
&& m_have_piece[j])
|
||||
piece_picker const& p = t->picker();
|
||||
int num_pieces = p.num_pieces();
|
||||
for (int j = 0; j != num_pieces; ++j)
|
||||
{
|
||||
interested = true;
|
||||
break;
|
||||
if (!p.have_piece(j)
|
||||
&& t->piece_priority(j) > 0
|
||||
&& m_have_piece[j])
|
||||
{
|
||||
interested = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
try
|
||||
|
Reference in New Issue
Block a user