trackerString = [@"http://" stringByAppendingString: trackerString];
//parse tracker string
- #warning check if it works with https
if (tr_httpParseURL([trackerString UTF8String], -1, NULL, NULL, NULL))
{
NSAlert * alert = [[[NSAlert alloc] init] autorelease];
return [NSString stringWithUTF8String: fStat->tracker_stat.scrapeResponse];
}
+#warning removes separators?
- (NSArray *) allTrackers: (BOOL) separators
{
- int count = fInfo->trackerCount;
- NSMutableArray * allTrackers = [NSMutableArray arrayWithCapacity: count + fInfo->trackers[count-1].tier + 1];
+ int count = fInfo->trackerCount, capacity = count;
+ if (separators)
+ capacity += fInfo->trackers[count-1].tier + 1;
+ NSMutableArray * allTrackers = [NSMutableArray arrayWithCapacity: capacity];
int i, tier = -1;
for (i = 0; i < count; i++)
{
- if (tier != fInfo->trackers[i].tier)
+ if (separators && tier != fInfo->trackers[i].tier)
{
tier = fInfo->trackers[i].tier;
[allTrackers addObject: [NSNumber numberWithInt: tier]];