diff options
Diffstat (limited to 'Source/SPArrayAdditions.m')
-rw-r--r-- | Source/SPArrayAdditions.m | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/Source/SPArrayAdditions.m b/Source/SPArrayAdditions.m index 0fe75483..0b851c1d 100644 --- a/Source/SPArrayAdditions.m +++ b/Source/SPArrayAdditions.m @@ -133,14 +133,10 @@ NSMutableArray *subArray = [NSMutableArray arrayWithCapacity:[indexes count]]; NSUInteger count = [self count]; - NSUInteger index = [indexes firstIndex]; - while ( index != NSNotFound ) - { + [indexes enumerateIndexesUsingBlock:^(NSUInteger index, BOOL * _Nonnull stop) { if ( index < count ) [subArray addObject: [self objectAtIndex: index]]; - - index = [indexes indexGreaterThanIndex: index]; - } + }]; return subArray; } |