Changeset 8220


Ignore:
Timestamp:
Apr 12, 2009, 5:31:17 PM (13 years ago)
Author:
charles
Message:

(trunk libT) in tr_torrentFiles(), avoid some expensive calculations if the torrent is a seed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/torrent.c

    r8215 r8220  
    10431043    tr_file_stat *        files = tr_new0( tr_file_stat, n );
    10441044    tr_file_stat *        walk = files;
     1045    const tr_bool         isSeed = tor->completeness == TR_SEED;
    10451046
    10461047    assert( tr_isTorrent( tor ) );
     
    10481049    for( i = 0; i < n; ++i, ++walk )
    10491050    {
    1050         const uint64_t b = fileBytesCompleted( tor, i );
     1051        const uint64_t b = isSeed ? tor->info.files[i].length : fileBytesCompleted( tor, i );
    10511052        walk->bytesCompleted = b;
    10521053        walk->progress = tr_getRatio( b, tor->info.files[i].length );
Note: See TracChangeset for help on using the changeset viewer.