Changeset 7522


Ignore:
Timestamp:
Dec 29, 2008, 3:03:11 AM (12 years ago)
Author:
livings124
Message:

small improvement to the group filtering code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Controller.m

    r7521 r7522  
    20042004    if (groupRows)
    20052005    {
    2006         NSArray * oldTorrentGroups = nil;
     2006        NSMutableArray * oldTorrentGroups = [NSMutableArray array];
    20072007        if ([fDisplayedTorrents count] > 0 && [[fDisplayedTorrents objectAtIndex: 0] isKindOfClass: [TorrentGroup class]])
    2008             oldTorrentGroups = [NSArray arrayWithArray: fDisplayedTorrents];
     2008            [oldTorrentGroups addObjectsFromArray: fDisplayedTorrents];
    20092009       
    20102010        [fDisplayedTorrents removeAllObjects];
     
    20252025               
    20262026                //try to see if the group already exists
    2027                 for (; oldTorrentGroups && currentOldGroupIndex < [oldTorrentGroups count]; currentOldGroupIndex++)
     2027                for (; currentOldGroupIndex < [oldTorrentGroups count]; currentOldGroupIndex++)
    20282028                {
    20292029                    TorrentGroup * currentGroup = [oldTorrentGroups objectAtIndex: currentOldGroupIndex];
    2030                     if ([currentGroup groupIndex] == groupValue)
     2030                    const NSInteger currentGroupValue = [currentGroup groupIndex];
     2031                    if (currentGroupValue == groupValue)
    20312032                    {
    20322033                        group = currentGroup;
    20332034                        [[currentGroup torrents] removeAllObjects];
     2035                       
     2036                        currentOldGroupIndex++;
     2037                    }
     2038                   
     2039                    if (currentGroupValue >= groupValue)
    20342040                        break;
    2035                     }
    20362041                }
    20372042               
Note: See TracChangeset for help on using the changeset viewer.