Changeset 10112


Ignore:
Timestamp:
Feb 6, 2010, 3:42:18 PM (12 years ago)
Author:
livings124
Message:

slight efficiency improvements for peers and webseeds in the inspector

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/InfoWindowController.m

    r10107 r10112  
    736736        if (fPeers)
    737737        {
    738             NSArray * oldPeers = fPeers;
    739             fPeers = [[fPeers sortedArrayUsingDescriptors: [self peerSortDescriptors]] retain];
    740             [oldPeers release];
     738            [fPeers sortUsingDescriptors: [self peerSortDescriptors]];
    741739            [tableView reloadData];
    742740        }
     
    746744        if (fWebSeeds)
    747745        {
    748             NSArray * oldWebSeeds = fWebSeeds;
    749             fWebSeeds = [[fWebSeeds sortedArrayUsingDescriptors: [fWebSeedTable sortDescriptors]] retain];
    750             [oldWebSeeds release];
     746            [fWebSeeds sortUsingDescriptors: [fWebSeedTable sortDescriptors]];
    751747            [tableView reloadData];
    752748        }
     
    12581254            [fPeersConnectField setStringValue: @""];
    12591255            [fPeersConnectLabel setEnabled: NO];
    1260        
     1256           
    12611257            [fPeers release];
    12621258            fPeers = nil;
     
    13901386    [fFileFilterField setStringValue: @""];
    13911387   
    1392     [fWebSeeds release];
    1393     fWebSeeds = nil;
    1394    
     1388    //reset webseeds here, since it might be hidden regardless of number selected
    13951389    BOOL hasWebSeeds = NO;
    13961390    for (Torrent * torrent in fTorrents)
     1391    {
    13971392        if ([torrent webSeedCount] > 0)
    13981393        {
     
    14001395            break;
    14011396        }
     1397    }
    14021398   
    14031399    if (!hasWebSeeds)
     1400    {
     1401        [fWebSeeds release];
     1402        fWebSeeds = nil;
    14041403        [fWebSeedTable reloadData];
     1404    }
    14051405    [self setWebSeedTableHidden: !hasWebSeeds animate: YES];
    14061406   
     
    15471547        return;
    15481548   
    1549     [fPeers release];
    1550     fPeers = [[NSMutableArray alloc] init];
     1549    if (!fPeers)
     1550        fPeers = [[NSMutableArray alloc] init];
     1551    else
     1552        [fPeers removeAllObjects];
    15511553   
    15521554    NSUInteger known = 0, connected = 0, tracker = 0, incoming = 0, cache = 0, pex = 0, dht = 0, ltep = 0,
     
    16391641    [fPeerTable reloadData];
    16401642   
    1641     [fWebSeeds release];
    1642     fWebSeeds = [[NSMutableArray alloc] init];
     1643    if (!fWebSeeds)
     1644        fWebSeeds = [[NSMutableArray alloc] init];
     1645    else
     1646        [fWebSeeds removeAllObjects];
    16431647   
    16441648    for (Torrent * torrent in fTorrents)
Note: See TracChangeset for help on using the changeset viewer.