Ignore:
Timestamp:
Nov 7, 2009, 4:48:02 AM (13 years ago)
Author:
livings124
Message:

small efficiency change for file inspector stats

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Torrent.m

    r9487 r9489  
    12301230        return 1.0;
    12311231   
     1232    if ([self fileCount] == 1)
     1233        return [self progress];
     1234   
    12321235    if (!fFileStat)
    12331236        [self updateFileStat];
     
    12531256- (BOOL) canChangeDownloadCheckForFile: (NSInteger) index
    12541257{
     1258    NSAssert2(index < [self fileCount], @"Index %d is greater than file count %d", index, [self fileCount]);
     1259   
     1260    if ([self fileCount] == 1 || [self isComplete])
     1261        return NO;
     1262   
    12551263    if (!fFileStat)
    12561264        [self updateFileStat];
    12571265   
    1258     return [self fileCount] > 1 && fFileStat[index].progress < 1.0;
     1266    return fFileStat[index].progress < 1.0;
    12591267}
    12601268
    12611269- (BOOL) canChangeDownloadCheckForFiles: (NSIndexSet *) indexSet
    12621270{
    1263     if ([self fileCount] <= 1 || [self isComplete])
     1271    if ([self fileCount] == 1 || [self isComplete])
    12641272        return NO;
    12651273   
Note: See TracChangeset for help on using the changeset viewer.