File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change 13
13
The following code snippets can be used to enumerate over the indexes in an NSIndexSet:
14
14
15
15
// Forward
16
- NSUInteger currentIndex = [ set firstIndex];
17
- while ( currentIndex != NSNotFound) {
16
+ var currentIndex = set. firstIndex
17
+ while currentIndex != NSNotFound {
18
18
...
19
- currentIndex = [ set indexGreaterThanIndex: currentIndex];
19
+ currentIndex = set. indexGreaterThanIndex( currentIndex)
20
20
}
21
-
21
+
22
22
// Backward
23
- NSUInteger currentIndex = [ set lastIndex];
24
- while ( currentIndex != NSNotFound) {
23
+ var currentIndex = set. lastIndex
24
+ while currentIndex != NSNotFound {
25
25
...
26
- currentIndex = [ set indexLessThanIndex: currentIndex];
26
+ currentIndex = set. indexLessThanIndex( currentIndex)
27
27
}
28
28
29
29
To enumerate without doing a call per index, you can use the method getIndexes:maxCount:inIndexRange:.
You can’t perform that action at this time.
0 commit comments