Ignore:
Timestamp:
Mar 15, 2010, 11:29:56 PM (12 years ago)
Author:
charles
Message:

(trunk libT) #3051 "faster startup by adding 'have all' idiom to .resume files" -- implemented in trunk for 2.00

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/completion.c

    r9868 r10387  
    165165}
    166166
     167
     168void
     169tr_cpSetHaveAll( tr_completion * cp )
     170{
     171    tr_piece_index_t i;
     172    tr_torrent * tor = cp->tor;
     173
     174    tr_cpReset( cp );
     175
     176    cp->sizeNow = tor->info.totalSize;
     177    tr_bitfieldAddRange( &cp->blockBitfield, 0, tor->blockCount );
     178    tr_bitfieldAddRange( &cp->pieceBitfield, 0, tor->info.pieceCount );
     179    for( i=0; i<tor->info.pieceCount; ++i )
     180        cp->completeBlocks[i] = tr_torPieceCountBlocks( tor, i );
     181    cp->sizeWhenDoneIsDirty = 1;
     182    cp->haveValidIsDirty = 1;
     183}
     184
    167185/* Initialize a completion object from a bitfield indicating which blocks we have */
    168186tr_bool
Note: See TracChangeset for help on using the changeset viewer.