1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-02-22 22:20:39 +00:00

(trunk libT) in peer-mgr's closeBadPeers() function, don't bother doing any of the setup/teardown calculations if the peer array is empty.

This commit is contained in:
Jordan Lee 2011-04-07 20:15:49 +00:00
parent 35eb016209
commit 6a53f72481

View file

@ -3320,12 +3320,15 @@ removeAllPeers( Torrent * t )
static void static void
closeBadPeers( Torrent * t, const time_t now_sec ) closeBadPeers( Torrent * t, const time_t now_sec )
{ {
int i; if( !tr_ptrArrayEmpty( &t->peers ) )
int peerCount; {
struct tr_peer ** peers = getPeersToClose( t, now_sec, &peerCount ); int i;
for( i=0; i<peerCount; ++i ) int peerCount;
closePeer( t, peers[i] ); struct tr_peer ** peers = getPeersToClose( t, now_sec, &peerCount );
tr_free( peers ); for( i=0; i<peerCount; ++i )
closePeer( t, peers[i] );
tr_free( peers );
}
} }
struct peer_liveliness struct peer_liveliness