simplify logic for saving resume a bit

This commit is contained in:
arvidn 2016-02-20 15:45:46 -05:00
parent 176d57ab8c
commit 3f40890eb6
1 changed files with 1 additions and 4 deletions

View File

@ -7262,9 +7262,6 @@ namespace libtorrent
// bit 0: set if we have the piece
// bit 1: set if we have verified the piece (in seed mode)
bool const is_checking = state() == torrent_status::checking_files;
bool const has_checked = state() == torrent_status::downloading
|| state() == torrent_status::finished
|| state() == torrent_status::seeding;
// if we are checking, only save the have_pieces bitfield up to the piece
// we have actually checked. This allows us to resume the checking when we
@ -7273,7 +7270,7 @@ namespace libtorrent
// bitfield.
int const max_piece
= is_checking ? m_num_checked_pieces
: has_checked ? m_torrent_file->num_pieces()
: m_files_checked ? m_torrent_file->num_pieces()
: 0;
if (max_piece > 0)