Ignore:
Timestamp:
Dec 26, 2009, 12:02:20 AM (13 years ago)
Author:
livings124
Message:

assorted code cleanup

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Controller.m

    r9812 r9822  
    21842184        [allTorrents sortUsingDescriptors: [NSArray arrayWithObject: groupDescriptor]];
    21852185       
    2186         NSMutableArray * groupTorrents;
     2186        TorrentGroup * group = nil;
    21872187        NSInteger lastGroupValue = -2, currentOldGroupIndex = 0;
    21882188        for (Torrent * torrent in allTorrents)
    21892189        {
    2190             NSInteger groupValue = [torrent groupValue];
     2190            const NSInteger groupValue = [torrent groupValue];
    21912191            if (groupValue != lastGroupValue)
    21922192            {
    21932193                lastGroupValue = groupValue;
    21942194               
    2195                 TorrentGroup * group = nil;
     2195                group = nil;
    21962196               
    21972197                //try to see if the group already exists
     
    22152215                    group = [[[TorrentGroup alloc] initWithGroup: groupValue] autorelease];
    22162216                [fDisplayedTorrents addObject: group];
    2217                
    2218                 groupTorrents = [group torrents];
    22192217            }
    22202218           
    2221             [groupTorrents addObject: torrent];
     2219            NSAssert(group != nil, @"No group object to add torrents to");
     2220            [[group torrents] addObject: torrent];
    22222221        }
    22232222    }
Note: See TracChangeset for help on using the changeset viewer.