1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-27 01:57:52 +00:00

minor speedups in tr_torrentStat() and in bitfield manipulation

This commit is contained in:
Charles Kerr 2008-05-30 15:40:46 +00:00
parent 468a883f23
commit 0705eaa1c0
2 changed files with 5 additions and 3 deletions

View file

@ -741,7 +741,9 @@ tr_torrentStat( tr_torrent * tor )
s->haveUnchecked = tr_cpHaveTotal( tor->completion ) - s->haveValid;
{
if( !s->leftUntilDone )
s->desiredAvailable = 0;
else {
tr_piece_index_t i;
tr_bitfield * peerPieces = tr_peerMgrGetAvailable( tor->handle->peerMgr,
tor->info.hash );

View file

@ -740,7 +740,7 @@ tr_bitfieldAdd( tr_bitfield * bitfield, size_t nth )
return -1;
bitfield->bits[i] |= ands[nth&7u];
assert( tr_bitfieldHas( bitfield, nth ) );
/*assert( tr_bitfieldHas( bitfield, nth ) );*/
return 0;
}
@ -771,7 +771,7 @@ tr_bitfieldRem( tr_bitfield * bitfield,
return -1;
bitfield->bits[i] &= rems[nth&7u];
assert( !tr_bitfieldHas( bitfield, nth ) );
/*assert( !tr_bitfieldHas( bitfield, nth ) );*/
return 0;
}