Ignore:
Timestamp:
Apr 11, 2009, 3:24:36 AM (13 years ago)
Author:
charles
Message:

(trunk libT) omit some unnecessary tests on the bitfield checks. these seem small, but bitfields are always the top CPU abuser when I profile...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/completion.c

    r7797 r8212  
    8383                /* we have part of the piece... */
    8484                const tr_block_index_t b = tr_torPieceFirstBlock( tor, i );
    85                 const tr_block_index_t e = b + tr_torPieceCountBlocks( tor,
    86                                                                        i );
    87                 tr_block_index_t       j;
     85                const tr_block_index_t e = b + tr_torPieceCountBlocks( tor, i );
     86                tr_block_index_t j;
    8887                for( j = b; j < e; ++j )
    89                     if( tr_cpBlockIsComplete( cp, j ) )
     88                    if( tr_cpBlockIsCompleteFast( cp, j ) )
    9089                        size += tr_torBlockCountBytes( tor, j );
    9190            }
     
    130129
    131130    for( block = start; block < end; ++block )
    132         if( tr_cpBlockIsComplete( cp, block ) )
     131        if( tr_cpBlockIsCompleteFast( cp, block ) )
    133132            cp->sizeNow -= tr_torBlockCountBytes( tor, block );
    134133
     
    344343
    345344    for( block=firstBlock; block<=lastBlock; ++block )
    346         if( !tr_cpBlockIsComplete( cp, block ) )
     345        if( !tr_cpBlockIsCompleteFast( cp, block ) )
    347346            return FALSE;
    348347
Note: See TracChangeset for help on using the changeset viewer.