fix calculation of tier value

This commit is contained in:
Mitchell Livingston 2008-04-24 06:42:45 +00:00
parent 59552d05e2
commit 9a23382cef
1 changed files with 7 additions and 3 deletions

View File

@ -772,13 +772,17 @@ void completenessChangeCallback(tr_torrent * torrent, cp_status_t status, void *
- (NSArray *) allTrackers: (BOOL) separators
{
NSMutableArray * allTrackers = [NSMutableArray array];
int count = fInfo->trackerCount;
NSMutableArray * allTrackers = [NSMutableArray arrayWithCapacity: count + fInfo->trackers[count-1].tier + 1];
int i, tier = -1;
for (i = 0; i < fInfo->trackerCount; i++)
for (i = 0; i < count; i++)
{
if (tier != fInfo->trackers[i].tier)
[allTrackers addObject: [NSNumber numberWithInt: i]];
{
tier = fInfo->trackers[i].tier;
[allTrackers addObject: [NSNumber numberWithInt: tier]];
}
[allTrackers addObject: [NSString stringWithUTF8String: fInfo->trackers[i].announce]];
}