Use the built-in method if on Tiger for making subarrays.

This commit is contained in:
Mitchell Livingston 2006-06-07 01:39:57 +00:00
parent d42c315496
commit 35a822e6d5
1 changed files with 10 additions and 5 deletions

View File

@ -403,12 +403,17 @@ static void sleepCallBack( void * controller, io_service_t y,
- (NSArray *) torrentsAtIndexes: (NSIndexSet *) indexSet
{
NSMutableArray * torrents = [NSMutableArray arrayWithCapacity: [indexSet count]];
unsigned int i;
for (i = [indexSet firstIndex]; i != NSNotFound; i = [indexSet indexGreaterThanIndex: i])
[torrents addObject: [fTorrents objectAtIndex: i]];
if ([fTorrents respondsToSelector: @selector(objectsAtIndexes:)])
return [fTorrents objectsAtIndexes: indexSet];
else
{
NSMutableArray * torrents = [NSMutableArray arrayWithCapacity: [indexSet count]];
unsigned int i;
for (i = [indexSet firstIndex]; i != NSNotFound; i = [indexSet indexGreaterThanIndex: i])
[torrents addObject: [fTorrents objectAtIndex: i]];
return torrents;
return torrents;
}
}
- (void) torrentNumberChanged