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:
parent
468a883f23
commit
0705eaa1c0
2 changed files with 5 additions and 3 deletions
|
@ -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 );
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue