Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 14 lines (10 sloc) 0.29 kb
bba7d18 Improve efficiency of shuffledArray to O(n). Add shuffle method to NS…
Justin Prieto authored
1 #import "NSMutableArray+SSToolkitAdditions.h"
2
3 @implementation NSMutableArray (SSToolkitAdditions)
4
5 - (void)shuffle
6 {
7 for (NSUInteger i = [self count] - 1; i > 0; i--) {
8 [self exchangeObjectAtIndex:arc4random_uniform(i + 1)
9 withObjectAtIndex:i];
10 }
11 }
12
13 @end
Something went wrong with that request. Please try again.