Changeset 13160
- Timestamp:
- Jan 14, 2012, 4:07:58 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/macosx/Torrent.m
r13152 r13160 1711 1711 { 1712 1712 //determine if folder node already exists 1713 FileListNode * node; 1714 for (node in fileList) 1715 if ([[node name] isEqualToString: name] && [node isFolder]) 1716 break; 1713 __block FileListNode * node = nil; 1714 [fileList enumerateObjectsWithOptions: NSEnumerationConcurrent usingBlock: ^(FileListNode * searchNode, NSUInteger idx, BOOL * stop) { 1715 if ([[searchNode name] isEqualToString: name] && [searchNode isFolder]) 1716 { 1717 node = searchNode; 1718 *stop = YES; 1719 } 1720 }]; 1717 1721 1718 1722 if (!node) … … 1723 1727 } 1724 1728 1725 NSMutableArray * trimmedComponents = [NSMutableArray arrayWithArray: [pathComponents subarrayWithRange: 1726 NSMakeRange(2, [pathComponents count]-2)]]; 1729 NSMutableArray * trimmedComponents = [NSMutableArray arrayWithArray: [pathComponents subarrayWithRange: NSMakeRange(2, [pathComponents count]-2)]]; 1727 1730 1728 1731 [node insertIndex: i withSize: file->length]; … … 1759 1762 const BOOL isFolder = [components count] > 1; 1760 1763 1764 //determine if folder node already exists 1761 1765 __block FileListNode * node = nil; 1762 1766 if (isFolder)
Note: See TracChangeset
for help on using the changeset viewer.