Changeset 13147


Ignore:
Timestamp:
Jan 8, 2012, 6:58:47 PM (10 years ago)
Author:
livings124
Message:

Fix a theoretical concurrency issue by generating an index set directly instead of enumerating objects and filling an index set.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Controller.m

    r13145 r13147  
    24172417       
    24182418        //remove empty groups
    2419         NSMutableIndexSet * removeIndexes = [NSMutableIndexSet indexSet];
    2420         [fDisplayedTorrents enumerateObjectsAtIndexes: [NSIndexSet indexSetWithIndexesInRange: NSMakeRange(0, originalGroupCount)] options: NSEnumerationConcurrent usingBlock: ^(id obj, NSUInteger idx, BOOL * stop) {
    2421             if ([[(TorrentGroup *)obj torrents] count] == 0)
    2422                 [removeIndexes addIndex: idx];
     2419        NSIndexSet * removeIndexes = [fDisplayedTorrents indexesOfObjectsAtIndexes: [NSIndexSet indexSetWithIndexesInRange: NSMakeRange(0, originalGroupCount)] options: NSEnumerationConcurrent passingTest: ^BOOL(id obj, NSUInteger idx, BOOL * stop) {
     2420            return [[(TorrentGroup *)obj torrents] count] == 0;
    24232421        }];
    24242422       
Note: See TracChangeset for help on using the changeset viewer.