(trunk libT) don't bother calling rechokeUploads() and rechokeDownloads() on torrents which have no peers.

This commit is contained in:
Jordan Lee 2011-04-02 08:35:47 +00:00
parent 616bde8c5b
commit 4a47e3c869
1 changed files with 5 additions and 2 deletions

View File

@ -3156,9 +3156,12 @@ rechokePulse( int foo UNUSED, short bar UNUSED, void * vmgr )
while(( tor = tr_torrentNext( mgr->session, tor ))) {
if( tor->isRunning ) {
rechokeUploads( tor->torrentPeers, now );
Torrent * t = tor->torrentPeers;
if( tr_ptrArraySize( &t->peers ) == 0 )
continue;
rechokeUploads( t, now );
if( !tr_torrentIsSeed( tor ) )
rechokeDownloads( tor->torrentPeers );
rechokeDownloads( t );
}
}