(trunk libT) disable the comparePieceByWeight assertions in trunk too.

This commit is contained in:
Charles Kerr 2010-03-07 22:56:14 +00:00
parent 6b546e8b4b
commit b1a29969fe
1 changed files with 21 additions and 18 deletions

View File

@ -728,24 +728,6 @@ comparePieceByWeight( const void * va, const void * vb )
return 0;
}
/**
* This function is useful for sanity checking,
* but is too expensive even for nightly builds...
* let's leave it disabled but add an easy hook to compile it back in
*/
#if 1
static void
assertWeightedPiecesAreSorted( Torrent * t )
{
int i;
weightTorrent = t->tor;
for( i=0; i<t->pieceCount-1; ++i )
assert( comparePieceByWeight( &t->pieces[i], &t->pieces[i+1] ) <= 0 );
}
#else
#define assertWeightedPiecesAreSorted(t)
#endif
static int
comparePieceByIndex( const void * va, const void * vb )
{
@ -792,6 +774,27 @@ isInEndgame( Torrent * t )
return endgame;
}
/**
* This function is useful for sanity checking,
* but is too expensive even for nightly builds...
* let's leave it disabled but add an easy hook to compile it back in
*/
#if 0
static void
assertWeightedPiecesAreSorted( Torrent * t )
{
if( !isInEndgame( t ) )
{
int i;
weightTorrent = t->tor;
for( i=0; i<t->pieceCount-1; ++i )
assert( comparePieceByWeight( &t->pieces[i], &t->pieces[i+1] ) <= 0 );
}
}
#else
#define assertWeightedPiecesAreSorted(t)
#endif
static struct weighted_piece *
pieceListLookup( Torrent * t, tr_piece_index_t index )
{