From 7326f4db326fe2b63215341a909903199d454611 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Tue, 24 Jul 2007 11:47:59 +0000 Subject: [PATCH] do the low-CPU tests first when deciding which blocks to request. these get called a /lot/ during endgame. --- libtransmission/peerutils.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libtransmission/peerutils.h b/libtransmission/peerutils.h index 6a3dc43a1..b2963360e 100644 --- a/libtransmission/peerutils.h +++ b/libtransmission/peerutils.h @@ -185,10 +185,10 @@ static int isBlockInteresting( const tr_torrent_t * tor, const tr_peer_t * peer, int block ) { - if( !isPieceInteresting( tor, peer, tr_blockPiece( block ) ) ) /* is piece interesting? */ + if( tr_cpBlockIsComplete( tor->completion, block )) /* we already have it */ return 0; - if( tr_cpBlockIsComplete( tor->completion, block )) /* we already have it */ + if( !isPieceInteresting( tor, peer, tr_blockPiece( block ))) /* is piece interesting? */ return 0; return 1;