opt call is_finished()

This commit is contained in:
pavel.pimenov 2017-11-09 19:01:39 +03:00 committed by Arvid Norberg
parent 381db57b42
commit 21eb9f782c
1 changed files with 6 additions and 6 deletions

View File

@ -3928,9 +3928,9 @@ namespace libtorrent {
remove_time_critical_piece(index, true); remove_time_critical_piece(index, true);
if (is_finished() if (m_state != torrent_status::finished
&& m_state != torrent_status::finished && m_state != torrent_status::seeding
&& m_state != torrent_status::seeding) && is_finished())
{ {
// torrent finished // torrent finished
// i.e. all the pieces we're interested in have // i.e. all the pieces we're interested in have
@ -5180,11 +5180,11 @@ namespace libtorrent {
#endif #endif
// the torrent just became finished // the torrent just became finished
if (is_finished() && !was_finished) if (!was_finished && is_finished())
{ {
finished(); finished();
} }
else if (!is_finished() && was_finished) else if (was_finished && !is_finished())
{ {
// if we used to be finished, but we aren't anymore // if we used to be finished, but we aren't anymore
// we may need to connect to peers again // we may need to connect to peers again
@ -7490,7 +7490,7 @@ namespace libtorrent {
state_updated(); state_updated();
} }
if (is_finished() && m_state != torrent_status::finished) if (m_state != torrent_status::finished && is_finished())
finished(); finished();
} }
else else