Ignore:
Timestamp:
Jan 3, 2009, 9:27:48 PM (12 years ago)
Author:
livings124
Message:

only increment the tier count for valid tiers

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Torrent.m

    r7519 r7598  
    760760- (NSMutableArray *) allTrackers: (BOOL) separators
    761761{
    762     NSInteger count = fInfo->trackerCount, capacity = count;
    763     if (separators)
    764         capacity += fInfo->trackers[count-1].tier + 1;
     762    const NSInteger count = fInfo->trackerCount;
     763    const NSInteger capacity = separators ? count + fInfo->trackers[count-1].tier + 1 : count;
    765764    NSMutableArray * allTrackers = [NSMutableArray arrayWithCapacity: capacity];
    766765   
     
    769768        if (separators && tier != fInfo->trackers[i].tier)
    770769        {
    771             tier = fInfo->trackers[i].tier;
     770            tier = fInfo->trackers[i].tier;NSLog(@"%d",tier);
    772771            [allTrackers addObject: [NSNumber numberWithInt: fAddedTrackers ? tier : tier + 1]];
    773772        }
Note: See TracChangeset for help on using the changeset viewer.