mirror of
https://github.com/transmission/transmission
synced 2025-01-31 03:12:44 +00:00
Use the built-in method if on Tiger for making subarrays.
This commit is contained in:
parent
d42c315496
commit
35a822e6d5
1 changed files with 10 additions and 5 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue