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