Changeset 5681


Ignore:
Timestamp:
Apr 24, 2008, 2:41:41 PM (14 years ago)
Author:
livings124
Message:

when getting the list of all trackers, exclude tiers when necessary

Location:
trunk/macosx
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/CreatorWindowController.m

    r5674 r5681  
    195195   
    196196    //parse tracker string
    197     #warning check if it works with https
    198197    if (tr_httpParseURL([trackerString UTF8String], -1, NULL, NULL, NULL))
    199198    {
  • trunk/macosx/Torrent.m

    r5679 r5681  
    771771}
    772772
     773#warning removes separators?
    773774- (NSArray *) allTrackers: (BOOL) separators
    774775{
    775     int count = fInfo->trackerCount;
    776     NSMutableArray * allTrackers = [NSMutableArray arrayWithCapacity: count + fInfo->trackers[count-1].tier + 1];
     776    int count = fInfo->trackerCount, capacity = count;
     777    if (separators)
     778        capacity += fInfo->trackers[count-1].tier + 1;
     779    NSMutableArray * allTrackers = [NSMutableArray arrayWithCapacity: capacity];
    777780   
    778781    int i, tier = -1;
    779782    for (i = 0; i < count; i++)
    780783    {
    781         if (tier != fInfo->trackers[i].tier)
     784        if (separators && tier != fInfo->trackers[i].tier)
    782785        {
    783786            tier = fInfo->trackers[i].tier;
Note: See TracChangeset for help on using the changeset viewer.