diff --git a/macosx/NSImageAdditions.m b/macosx/NSImageAdditions.m index b9954e9f3..ec3b92214 100644 --- a/macosx/NSImageAdditions.m +++ b/macosx/NSImageAdditions.m @@ -33,7 +33,9 @@ [coloredImage lockFocus]; [color set]; - NSRectFillUsingOperation(NSMakeRect(0.0, 0.0, [coloredImage size].width, [coloredImage size].height), NSCompositeSourceAtop); + + const NSSize size = [coloredImage size]; + NSRectFillUsingOperation(NSMakeRect(0.0, 0.0, size.width, size.height), NSCompositeSourceAtop); [coloredImage unlockFocus]; diff --git a/macosx/Torrent.m b/macosx/Torrent.m index d7b1d8b6b..b83e7e1a0 100644 --- a/macosx/Torrent.m +++ b/macosx/Torrent.m @@ -1761,9 +1761,11 @@ int trashDataFile(const char * filename) FileListNode * node = nil; if (isFolder) { - for (node in [parent children]) - if ([[node name] isEqualToString: name] && [node isFolder]) - break; + const NSUInteger nodeIndex = [[parent children] indexOfObjectWithOptions: NSEnumerationConcurrent passingTest: ^BOOL(FileListNode * searchNode, NSUInteger idx, BOOL * stop) { + return [[searchNode name] isEqualToString: name] && [searchNode isFolder]; + }]; + if (nodeIndex != NSNotFound) + node = [[parent children] objectAtIndex: nodeIndex]; } //create new folder or file if it doesn't already exist @@ -1796,9 +1798,10 @@ int trashDataFile(const char * filename) NSSortDescriptor * descriptor = [NSSortDescriptor sortDescriptorWithKey: @"name" ascending: YES selector: @selector(localizedStandardCompare:)]; [fileNodes sortUsingDescriptors: [NSArray arrayWithObject: descriptor]]; - for (FileListNode * node in fileNodes) + [fileNodes enumerateObjectsWithOptions: NSEnumerationConcurrent usingBlock: ^(FileListNode * node, NSUInteger idx, BOOL * stop) { if ([node isFolder]) [self sortFileList: [node children]]; + }]; } - (void) startQueue