Changeset 13152


Ignore:
Timestamp:
Jan 9, 2012, 4:27:09 AM (10 years ago)
Author:
livings124
Message:

better enumeration when generating a torrent's file list

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Torrent.m

    r13151 r13152  
    17591759    const BOOL isFolder = [components count] > 1;
    17601760   
    1761     FileListNode * node = nil;
     1761    __block FileListNode * node = nil;
    17621762    if (isFolder)
    17631763    {
    1764         const NSUInteger nodeIndex = [[parent children] indexOfObjectWithOptions: NSEnumerationConcurrent passingTest: ^BOOL(FileListNode * searchNode, NSUInteger idx, BOOL * stop) {
    1765             return [[searchNode name] isEqualToString: name] && [searchNode isFolder];
     1764        [[parent children] enumerateObjectsWithOptions: NSEnumerationConcurrent usingBlock: ^(FileListNode * searchNode, NSUInteger idx, BOOL * stop) {
     1765            if ([[searchNode name] isEqualToString: name] && [searchNode isFolder])
     1766            {
     1767                node = searchNode;
     1768                *stop = YES;
     1769            }
    17661770        }];
    1767         if (nodeIndex != NSNotFound)
    1768             node = [[parent children] objectAtIndex: nodeIndex];
    17691771    }
    17701772   
Note: See TracChangeset for help on using the changeset viewer.