@@ -190,7 +190,7 @@ public class NSArray : NSObject, NSCopying, NSMutableCopying, NSSecureCoding, NS
190
190
}
191
191
192
192
public func indexOfObject( anObject: AnyObject ) -> Int {
193
- for var idx = 0 ; idx < count; idx ++ {
193
+ for idx in 0 ..< count {
194
194
let obj = objectAtIndex ( idx) as! NSObject
195
195
if anObject === obj || obj. isEqual ( anObject) {
196
196
return idx
@@ -200,7 +200,7 @@ public class NSArray : NSObject, NSCopying, NSMutableCopying, NSSecureCoding, NS
200
200
}
201
201
202
202
public func indexOfObject( anObject: AnyObject , inRange range: NSRange ) -> Int {
203
- for var idx = 0 ; idx < range. length; idx ++ {
203
+ for idx in 0 ..< range. length {
204
204
let obj = objectAtIndex ( idx + range. location) as! NSObject
205
205
if anObject === obj || obj. isEqual ( anObject) {
206
206
return idx
@@ -210,7 +210,7 @@ public class NSArray : NSObject, NSCopying, NSMutableCopying, NSSecureCoding, NS
210
210
}
211
211
212
212
public func indexOfObjectIdenticalTo( anObject: AnyObject ) -> Int {
213
- for var idx = 0 ; idx < count; idx ++ {
213
+ for idx in 0 ..< count {
214
214
let obj = objectAtIndex ( idx) as! NSObject
215
215
if anObject === obj {
216
216
return idx
@@ -220,7 +220,7 @@ public class NSArray : NSObject, NSCopying, NSMutableCopying, NSSecureCoding, NS
220
220
}
221
221
222
222
public func indexOfObjectIdenticalTo( anObject: AnyObject , inRange range: NSRange ) -> Int {
223
- for var idx = 0 ; idx < range. length; idx ++ {
223
+ for idx in 0 ..< range. length {
224
224
let obj = objectAtIndex ( idx + range. location) as! NSObject
225
225
if anObject === obj {
226
226
return idx
@@ -234,7 +234,7 @@ public class NSArray : NSObject, NSCopying, NSMutableCopying, NSSecureCoding, NS
234
234
return false
235
235
}
236
236
237
- for var idx = 0 ; idx < count; idx ++ {
237
+ for idx in 0 ..< count {
238
238
let obj1 = objectAtIndex ( idx) as! NSObject
239
239
let obj2 = otherArray [ idx] as! NSObject
240
240
if obj1 === obj2 {
@@ -301,7 +301,7 @@ public class NSArray : NSObject, NSCopying, NSMutableCopying, NSSecureCoding, NS
301
301
/*@NSCopying*/ public var sortedArrayHint : NSData {
302
302
get {
303
303
let buffer = UnsafeMutablePointer< Int32> . alloc( count)
304
- for var idx = 0 ; idx < count; idx ++ {
304
+ for idx in 0 ..< count {
305
305
let item = objectAtIndex ( idx) as! NSObject
306
306
let hash = item. hash
307
307
buffer. advancedBy ( idx) . memory = Int32 ( hash) . littleEndian
@@ -512,7 +512,7 @@ public class NSMutableArray : NSArray {
512
512
513
513
public required convenience init ( objects: UnsafePointer < AnyObject ? > , count cnt: Int ) {
514
514
self . init ( capacity: cnt)
515
- for var idx = 0 ; idx < cnt; idx ++ {
515
+ for idx in 0 ..< cnt {
516
516
_storage. append ( objects [ idx] !)
517
517
}
518
518
}
@@ -608,10 +608,10 @@ public class NSMutableArray : NSArray {
608
608
public func replaceObjectsInRange( range: NSRange , withObjectsFromArray otherArray: [ AnyObject ] ) {
609
609
if self . dynamicType === NSMutableArray . self {
610
610
_storage. reserveCapacity ( count - range. length + otherArray. count)
611
- for var idx = 0 ; idx < range. length; idx ++ {
611
+ for idx in 0 ..< range. length {
612
612
_storage [ idx + range. location] = otherArray [ idx]
613
613
}
614
- for var idx = range. length; idx < otherArray . count ; idx ++ {
614
+ for idx in range. length..< otherArray. count {
615
615
_storage. insert ( otherArray [ idx] , atIndex: idx + range. location)
616
616
}
617
617
} else {
0 commit comments