r2377 cleanup

This commit is contained in:
Charles Kerr 2007-07-16 23:52:05 +00:00
parent 091a56d4ca
commit 9c7a913cdc
1 changed files with 3 additions and 2 deletions

View File

@ -1258,7 +1258,7 @@ tr_torrentSetFileDL( tr_torrent_t * tor,
int fileIndex,
int doDownload )
{
const tr_file_t * file;
tr_file_t * file;
const int dnd = !doDownload;
int firstPiece, firstPieceDND;
int lastPiece, lastPieceDND;
@ -1267,6 +1267,7 @@ tr_torrentSetFileDL( tr_torrent_t * tor,
tr_torrentWriterLock( tor );
file = &tor->info.files[fileIndex];
file->dnd = dnd;
firstPiece = file->firstPiece;
lastPiece = file->lastPiece;
@ -1296,7 +1297,7 @@ tr_torrentSetFileDL( tr_torrent_t * tor,
{
tor->info.pieces[firstPiece].dnd = firstPieceDND;
tor->info.pieces[lastPiece].dnd = lastPieceDND;
for( i=firstPiece+1; i<lastPiece-1; ++i )
for( i=firstPiece+1; i<lastPiece; ++i )
tor->info.pieces[i].dnd = dnd;
}