Changeset 7027
- Timestamp:
- Nov 3, 2008, 5:01:08 PM (12 years ago)
- Location:
- trunk/libtransmission
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libtransmission/completion.c
r6935 r7027 304 304 tr_cpHaveValid( const tr_completion * cp ) 305 305 { 306 uint64_t b = 0; 307 tr_piece_index_t i; 308 const tr_torrent * tor = cp->tor; 309 310 for( i = 0; i < tor->info.pieceCount; ++i ) 306 uint64_t b = 0; 307 tr_piece_index_t i; 308 const tr_torrent * tor = cp->tor; 309 const uint64_t pieceSize = tor->info.pieceSize; 310 const uint64_t lastPieceSize = tor->lastPieceSize; 311 const tr_piece_index_t lastPiece = tor->info.pieceCount - 1; 312 313 for( i=0; i!=lastPiece; ++i ) 311 314 if( tr_cpPieceIsComplete( cp, i ) ) 312 b += tr_torPieceCountBytes( tor, i ); 315 b += pieceSize; 316 317 if( tr_cpPieceIsComplete( cp, lastPiece ) ) 318 b += lastPieceSize; 313 319 314 320 return b; -
trunk/libtransmission/torrent.c
r6975 r7027 100 100 101 101 while( ( tor = tr_torrentNext( handle, tor ) ) ) 102 if( !memcmp( tor->info.hash, torrentHash, SHA_DIGEST_LENGTH ) ) 103 return tor; 102 if( *tor->info.hash == *torrentHash ) 103 if( !memcmp( tor->info.hash, torrentHash, SHA_DIGEST_LENGTH ) ) 104 return tor; 104 105 105 106 return NULL;
Note: See TracChangeset
for help on using the changeset viewer.