Changeset 5679


Ignore:
Timestamp:
Apr 24, 2008, 6:42:45 AM (14 years ago)
Author:
livings124
Message:

fix calculation of tier value

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Torrent.m

    r5678 r5679  
    773773- (NSArray *) allTrackers: (BOOL) separators
    774774{
    775     NSMutableArray * allTrackers = [NSMutableArray array];
     775    int count = fInfo->trackerCount;
     776    NSMutableArray * allTrackers = [NSMutableArray arrayWithCapacity: count + fInfo->trackers[count-1].tier + 1];
    776777   
    777778    int i, tier = -1;
    778     for (i = 0; i < fInfo->trackerCount; i++)
     779    for (i = 0; i < count; i++)
    779780    {
    780781        if (tier != fInfo->trackers[i].tier)
    781             [allTrackers addObject: [NSNumber numberWithInt: i]];
     782        {
     783            tier = fInfo->trackers[i].tier;
     784            [allTrackers addObject: [NSNumber numberWithInt: tier]];
     785        }
    782786       
    783787        [allTrackers addObject: [NSString stringWithUTF8String: fInfo->trackers[i].announce]];
Note: See TracChangeset for help on using the changeset viewer.