Changeset 8219


Ignore:
Timestamp:
Apr 12, 2009, 5:29:35 PM (12 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
  • branches/1.5x/libtransmission/torrent.c

    r8218 r8219  
    926926    tr_file_stat *        files = tr_new0( tr_file_stat, n );
    927927    tr_file_stat *        walk = files;
     928    const tr_bool         isSeed = tor->completeness == TR_SEED;
    928929
    929930    assert( tr_isTorrent( tor ) );
     
    931932    for( i = 0; i < n; ++i, ++walk )
    932933    {
    933         const uint64_t b = fileBytesCompleted( tor, i );
     934        const uint64_t b = isSeed ? tor->info.files[i].length : fileBytesCompleted( tor, i );
    934935        walk->bytesCompleted = b;
    935936        walk->progress = tr_getRatio( b, tor->info.files[i].length );
Note: See TracChangeset for help on using the changeset viewer.