]> granicus.if.org Git - transmission/commitdiff
#917: small speedup to r5759 suggested by BentMyWookie
authorCharles Kerr <charles@transmissionbt.com>
Tue, 6 May 2008 19:39:16 +0000 (19:39 +0000)
committerCharles Kerr <charles@transmissionbt.com>
Tue, 6 May 2008 19:39:16 +0000 (19:39 +0000)
libtransmission/peer-mgr.c

index 6070b4dfb9292bf3ead5dd5d1bf69c32cc1da5c2..94c4e497f26c86a1aeebd8f1e925c7315f133f59 100644 (file)
@@ -1734,6 +1734,8 @@ shouldPeerBeClosed( const Torrent * t, const tr_peer * peer, int peerCount )
         int peerHasEverything;
         if( atom->flags & ADDED_F_SEED_FLAG )
             peerHasEverything = TRUE;
+        else if( peer->progress < tr_cpPercentDone( tor->completion ) )
+            peerHasEverything = FALSE;
         else {
             tr_bitfield * tmp = tr_bitfieldDup( tr_cpPieceBitfield( tor->completion ) );
             tr_bitfieldDifference( tmp, peer->have );