1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-01-30 19:03:04 +00:00

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

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