optimization for files with prioritiy 0

This commit is contained in:
Arvid Norberg 2008-09-19 19:46:04 +00:00
parent 67f1242836
commit 064d93b935
1 changed files with 2 additions and 0 deletions

View File

@ -1838,6 +1838,8 @@ namespace libtorrent
size_type size = m_torrent_file->files().at(i).size;
if (size == 0) continue;
position += size;
if (m_file_priority[i] == 0) continue;
// mark all pieces of the file with this file's priority
// but only if the priority is higher than the pieces
// already set (to avoid problems with overlapping pieces)