@@ -107,7 +107,7 @@ open class NSIndexSet : NSObject, NSCopying, NSMutableCopying, NSSecureCoding {
107
107
}
108
108
109
109
public convenience init ( index value: Int ) {
110
- self . init ( indexesIn: NSMakeRange ( value, 1 ) )
110
+ self . init ( indexesIn: NSRange ( location : value, length : 1 ) )
111
111
}
112
112
113
113
open func isEqual( to indexSet: IndexSet ) -> Bool {
@@ -448,7 +448,7 @@ open class NSIndexSet : NSObject, NSCopying, NSMutableCopying, NSSecureCoding {
448
448
enumerate ( options: [ ] , using: block)
449
449
}
450
450
open func enumerate( options opts: NSEnumerationOptions = [ ] , using block: ( Int , UnsafeMutablePointer < ObjCBool > ) -> Void ) {
451
- let _ = _enumerateWithOptions ( opts, range: NSMakeRange ( 0 , Int . max) , paramType: Int . self, returnType: Void . self, block: block)
451
+ let _ = _enumerateWithOptions ( opts, range: NSRange ( location : 0 , length : Int . max) , paramType: Int . self, returnType: Void . self, block: block)
452
452
}
453
453
open func enumerate( in range: NSRange , options opts: NSEnumerationOptions = [ ] , using block: ( Int , UnsafeMutablePointer < ObjCBool > ) -> Void ) {
454
454
let _ = _enumerateWithOptions ( opts, range: range, paramType: Int . self, returnType: Void . self, block: block)
@@ -458,17 +458,17 @@ open class NSIndexSet : NSObject, NSCopying, NSMutableCopying, NSSecureCoding {
458
458
return index ( options: [ ] , passingTest: predicate)
459
459
}
460
460
open func index( options opts: NSEnumerationOptions = [ ] , passingTest predicate: ( Int , UnsafeMutablePointer < ObjCBool > ) -> Bool ) -> Int {
461
- return _enumerateWithOptions ( opts, range: NSMakeRange ( 0 , Int . max) , paramType: Int . self, returnType: Bool . self, block: predicate) ?? NSNotFound
461
+ return _enumerateWithOptions ( opts, range: NSRange ( location : 0 , length : Int . max) , paramType: Int . self, returnType: Bool . self, block: predicate) ?? NSNotFound
462
462
}
463
463
open func index( in range: NSRange , options opts: NSEnumerationOptions = [ ] , passingTest predicate: ( Int , UnsafeMutablePointer < ObjCBool > ) -> Bool ) -> Int {
464
464
return _enumerateWithOptions ( opts, range: range, paramType: Int . self, returnType: Bool . self, block: predicate) ?? NSNotFound
465
465
}
466
466
467
467
open func indexes( passingTest predicate: ( Int , UnsafeMutablePointer < ObjCBool > ) -> Bool ) -> IndexSet {
468
- return indexes ( in: NSMakeRange ( 0 , Int . max) , options: [ ] , passingTest: predicate)
468
+ return indexes ( in: NSRange ( location : 0 , length : Int . max) , options: [ ] , passingTest: predicate)
469
469
}
470
470
open func indexes( options opts: NSEnumerationOptions = [ ] , passingTest predicate: ( Int , UnsafeMutablePointer < ObjCBool > ) -> Bool ) -> IndexSet {
471
- return indexes ( in: NSMakeRange ( 0 , Int . max) , options: opts, passingTest: predicate)
471
+ return indexes ( in: NSRange ( location : 0 , length : Int . max) , options: opts, passingTest: predicate)
472
472
}
473
473
open func indexes( in range: NSRange , options opts: NSEnumerationOptions = [ ] , passingTest predicate: ( Int , UnsafeMutablePointer < ObjCBool > ) -> Bool ) -> IndexSet {
474
474
var result = IndexSet ( )
@@ -489,7 +489,7 @@ open class NSIndexSet : NSObject, NSCopying, NSMutableCopying, NSSecureCoding {
489
489
enumerateRanges ( options: [ ] , using: block)
490
490
}
491
491
open func enumerateRanges( options opts: NSEnumerationOptions = [ ] , using block: ( NSRange , UnsafeMutablePointer < ObjCBool > ) -> Void ) {
492
- let _ = _enumerateWithOptions ( opts, range: NSMakeRange ( 0 , Int . max) , paramType: NSRange . self, returnType: Void . self, block: block)
492
+ let _ = _enumerateWithOptions ( opts, range: NSRange ( location : 0 , length : Int . max) , paramType: NSRange . self, returnType: Void . self, block: block)
493
493
}
494
494
open func enumerateRanges( in range: NSRange , options opts: NSEnumerationOptions = [ ] , using block: ( NSRange , UnsafeMutablePointer < ObjCBool > ) -> Void ) {
495
495
let _ = _enumerateWithOptions ( opts, range: range, paramType: NSRange . self, returnType: Void . self, block: block)
@@ -553,11 +553,11 @@ open class NSMutableIndexSet : NSIndexSet {
553
553
}
554
554
555
555
open func add( _ value: Int ) {
556
- add ( in: NSMakeRange ( value, 1 ) )
556
+ add ( in: NSRange ( location : value, length : 1 ) )
557
557
}
558
558
559
559
open func remove( _ value: Int ) {
560
- remove ( in: NSMakeRange ( value, 1 ) )
560
+ remove ( in: NSRange ( location : value, length : 1 ) )
561
561
}
562
562
563
563
internal func _insertRange( _ range: NSRange , atIndex index: Int ) {
@@ -672,16 +672,16 @@ open class NSMutableIndexSet : NSIndexSet {
672
672
// Don't increment rangeIndex
673
673
continue
674
674
} else {
675
- self . _replaceRangeAtIndex ( rangeIndex, withRange: NSMakeRange ( removeEnd, curEnd - removeEnd) )
675
+ self . _replaceRangeAtIndex ( rangeIndex, withRange: NSRange ( location : removeEnd, length : curEnd - removeEnd) )
676
676
return
677
677
}
678
678
} else if range. location > curRange. location && removeEnd < curEnd {
679
- let firstPiece = NSMakeRange ( curRange. location, range. location - curRange. location)
680
- let secondPiece = NSMakeRange ( removeEnd, curEnd - removeEnd)
679
+ let firstPiece = NSRange ( location : curRange. location, length : range. location - curRange. location)
680
+ let secondPiece = NSRange ( location : removeEnd, length : curEnd - removeEnd)
681
681
_replaceRangeAtIndex ( rangeIndex, withRange: secondPiece)
682
682
_insertRange ( firstPiece, atIndex: rangeIndex)
683
683
} else if range. location > curRange. location && range. location < curEnd && removeEnd >= curEnd {
684
- _replaceRangeAtIndex ( rangeIndex, withRange: NSMakeRange ( curRange. location, range. location - curRange. location) )
684
+ _replaceRangeAtIndex ( rangeIndex, withRange: NSRange ( location : curRange. location, length : range. location - curRange. location) )
685
685
}
686
686
rangeIndex += 1
687
687
}
0 commit comments