Changeset 5815


Ignore:
Timestamp:
May 12, 2008, 1:37:38 AM (14 years ago)
Author:
livings124
Message:

remove useless "sorted" variables

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Controller.m

    r5814 r5815  
    15401540   
    15411541    //sort torrents by order value
    1542     NSArray * sortedTorrents;
    15431542    if ([fTorrents count] > 1 && (desiredDownloadActive > 0 || desiredSeedActive > 0))
    15441543    {
    15451544        NSSortDescriptor * orderDescriptor = [[[NSSortDescriptor alloc] initWithKey: @"orderValue" ascending: YES] autorelease];
    1546         sortedTorrents = [fTorrents sortedArrayUsingDescriptors: [NSArray arrayWithObject: orderDescriptor]];
    1547     }
    1548     else
    1549         sortedTorrents = fTorrents;
     1545        [fTorrents sortUsingDescriptors: [NSArray arrayWithObject: orderDescriptor]];
     1546    }
    15501547   
    15511548    Torrent * torrent;
    1552     NSEnumerator * enumerator = [sortedTorrents objectEnumerator];
     1549    NSEnumerator * enumerator = [fTorrents objectEnumerator];
    15531550    while ((torrent = [enumerator nextObject]))
    15541551    {
     
    26912688        //get all torrents to reorder
    26922689        NSSortDescriptor * orderDescriptor = [[[NSSortDescriptor alloc] initWithKey: @"orderValue" ascending: YES] autorelease];
    2693         NSMutableArray * sortedTorrents = [[fTorrents sortedArrayUsingDescriptors:
    2694                                             [NSArray arrayWithObject: orderDescriptor]] mutableCopy];
     2690        [fTorrents sortUsingDescriptors: [NSArray arrayWithObject: orderDescriptor]];
    26952691       
    26962692        //remove objects to reinsert
    2697         [sortedTorrents removeObjectsInArray: movingTorrents];
     2693        [fTorrents removeObjectsInArray: movingTorrents];
    26982694       
    26992695        //insert objects at new location
    2700         int insertIndex = topTorrent ? [sortedTorrents indexOfObject: topTorrent] + 1 : 0;
     2696        int insertIndex = topTorrent ? [fTorrents indexOfObject: topTorrent] + 1 : 0;
    27012697        for (i = 0; i < [movingTorrents count]; i++)
    2702             [sortedTorrents insertObject: [movingTorrents objectAtIndex: i] atIndex: insertIndex + i];
     2698            [fTorrents insertObject: [movingTorrents objectAtIndex: i] atIndex: insertIndex + i];
    27032699       
    27042700        //redo order values
    2705         for (i = 0; i < [sortedTorrents count]; i++)
    2706             [[sortedTorrents objectAtIndex: i] setOrderValue: i];
    2707        
    2708         [sortedTorrents release];
     2701        for (i = 0; i < [fTorrents count]; i++)
     2702            [[fTorrents objectAtIndex: i] setOrderValue: i];
    27092703       
    27102704        [self applyFilter: nil];
Note: See TracChangeset for help on using the changeset viewer.