22//
33// This source file is part of the Swift.org open source project
44//
5- // Copyright (c) 2014 - 2019 Apple Inc. and the Swift project authors
5+ // Copyright (c) 2014 - 2020 Apple Inc. and the Swift project authors
66// Licensed under Apache License v2.0 with Runtime Library Exception
77//
88// See https://swift.org/LICENSE.txt for license information
@@ -743,7 +743,7 @@ internal final class _CollectionBox<S: Collection>: _AnyCollectionBox<S.Element>
743743 internal override func _index(
744744 _ i: _AnyIndexBox , offsetBy n: Int
745745 ) -> _AnyIndexBox {
746- return _IndexBox ( _base: _base. index ( _unbox ( i) , offsetBy: numericCast ( n ) ) )
746+ return _IndexBox ( _base: _base. index ( _unbox ( i) , offsetBy: n ) )
747747 }
748748
749749 @inlinable
@@ -752,10 +752,7 @@ internal final class _CollectionBox<S: Collection>: _AnyCollectionBox<S.Element>
752752 offsetBy n: Int ,
753753 limitedBy limit: _AnyIndexBox
754754 ) -> _AnyIndexBox ? {
755- return _base. index (
756- _unbox ( i) ,
757- offsetBy: numericCast ( n) ,
758- limitedBy: _unbox ( limit) )
755+ return _base. index ( _unbox ( i) , offsetBy: n, limitedBy: _unbox ( limit) )
759756 . map { _IndexBox ( _base: $0) }
760757 }
761758
@@ -764,7 +761,7 @@ internal final class _CollectionBox<S: Collection>: _AnyCollectionBox<S.Element>
764761 _ i: inout _AnyIndexBox , offsetBy n: Int
765762 ) {
766763 if let box = i as? _IndexBox < S . Index > {
767- return _base. formIndex ( & box. _base, offsetBy: numericCast ( n ) )
764+ return _base. formIndex ( & box. _base, offsetBy: n )
768765 }
769766 fatalError ( " Index type mismatch! " )
770767 }
@@ -774,10 +771,7 @@ internal final class _CollectionBox<S: Collection>: _AnyCollectionBox<S.Element>
774771 _ i: inout _AnyIndexBox , offsetBy n: Int , limitedBy limit: _AnyIndexBox
775772 ) -> Bool {
776773 if let box = i as? _IndexBox < S . Index > {
777- return _base. formIndex (
778- & box. _base,
779- offsetBy: numericCast ( n) ,
780- limitedBy: _unbox ( limit) )
774+ return _base. formIndex ( & box. _base, offsetBy: n, limitedBy: _unbox ( limit) )
781775 }
782776 fatalError ( " Index type mismatch! " )
783777 }
@@ -787,12 +781,12 @@ internal final class _CollectionBox<S: Collection>: _AnyCollectionBox<S.Element>
787781 from start: _AnyIndexBox ,
788782 to end: _AnyIndexBox
789783 ) -> Int {
790- return numericCast ( _base. distance ( from: _unbox ( start) , to: _unbox ( end) ) )
784+ return _base. distance ( from: _unbox ( start) , to: _unbox ( end) )
791785 }
792786
793787 @inlinable
794788 internal override var _count : Int {
795- return numericCast ( _base. count)
789+ return _base. count
796790 }
797791
798792 @usableFromInline
@@ -949,7 +943,7 @@ internal final class _BidirectionalCollectionBox<S: BidirectionalCollection>
949943 internal override func _index(
950944 _ i: _AnyIndexBox , offsetBy n: Int
951945 ) -> _AnyIndexBox {
952- return _IndexBox ( _base: _base. index ( _unbox ( i) , offsetBy: numericCast ( n ) ) )
946+ return _IndexBox ( _base: _base. index ( _unbox ( i) , offsetBy: n ) )
953947 }
954948
955949 @inlinable
@@ -958,11 +952,7 @@ internal final class _BidirectionalCollectionBox<S: BidirectionalCollection>
958952 offsetBy n: Int ,
959953 limitedBy limit: _AnyIndexBox
960954 ) -> _AnyIndexBox ? {
961- return _base. index (
962- _unbox ( i) ,
963- offsetBy: numericCast ( n) ,
964- limitedBy: _unbox ( limit)
965- )
955+ return _base. index ( _unbox ( i) , offsetBy: n, limitedBy: _unbox ( limit) )
966956 . map { _IndexBox ( _base: $0) }
967957 }
968958
@@ -971,7 +961,7 @@ internal final class _BidirectionalCollectionBox<S: BidirectionalCollection>
971961 _ i: inout _AnyIndexBox , offsetBy n: Int
972962 ) {
973963 if let box = i as? _IndexBox < S . Index > {
974- return _base. formIndex ( & box. _base, offsetBy: numericCast ( n ) )
964+ return _base. formIndex ( & box. _base, offsetBy: n )
975965 }
976966 fatalError ( " Index type mismatch! " )
977967 }
@@ -981,10 +971,7 @@ internal final class _BidirectionalCollectionBox<S: BidirectionalCollection>
981971 _ i: inout _AnyIndexBox , offsetBy n: Int , limitedBy limit: _AnyIndexBox
982972 ) -> Bool {
983973 if let box = i as? _IndexBox < S . Index > {
984- return _base. formIndex (
985- & box. _base,
986- offsetBy: numericCast ( n) ,
987- limitedBy: _unbox ( limit) )
974+ return _base. formIndex ( & box. _base, offsetBy: n, limitedBy: _unbox ( limit) )
988975 }
989976 fatalError ( " Index type mismatch! " )
990977 }
@@ -994,12 +981,12 @@ internal final class _BidirectionalCollectionBox<S: BidirectionalCollection>
994981 from start: _AnyIndexBox ,
995982 to end: _AnyIndexBox
996983 ) -> Int {
997- return numericCast ( _base. distance ( from: _unbox ( start) , to: _unbox ( end) ) )
984+ return _base. distance ( from: _unbox ( start) , to: _unbox ( end) )
998985 }
999986
1000987 @inlinable
1001988 internal override var _count : Int {
1002- return numericCast ( _base. count)
989+ return _base. count
1003990 }
1004991
1005992 @inlinable
@@ -1168,7 +1155,7 @@ internal final class _RandomAccessCollectionBox<S: RandomAccessCollection>
11681155 internal override func _index(
11691156 _ i: _AnyIndexBox , offsetBy n: Int
11701157 ) -> _AnyIndexBox {
1171- return _IndexBox ( _base: _base. index ( _unbox ( i) , offsetBy: numericCast ( n ) ) )
1158+ return _IndexBox ( _base: _base. index ( _unbox ( i) , offsetBy: n ) )
11721159 }
11731160
11741161 @inlinable
@@ -1177,11 +1164,7 @@ internal final class _RandomAccessCollectionBox<S: RandomAccessCollection>
11771164 offsetBy n: Int ,
11781165 limitedBy limit: _AnyIndexBox
11791166 ) -> _AnyIndexBox ? {
1180- return _base. index (
1181- _unbox ( i) ,
1182- offsetBy: numericCast ( n) ,
1183- limitedBy: _unbox ( limit)
1184- )
1167+ return _base. index ( _unbox ( i) , offsetBy: n, limitedBy: _unbox ( limit) )
11851168 . map { _IndexBox ( _base: $0) }
11861169 }
11871170
@@ -1190,7 +1173,7 @@ internal final class _RandomAccessCollectionBox<S: RandomAccessCollection>
11901173 _ i: inout _AnyIndexBox , offsetBy n: Int
11911174 ) {
11921175 if let box = i as? _IndexBox < S . Index > {
1193- return _base. formIndex ( & box. _base, offsetBy: numericCast ( n ) )
1176+ return _base. formIndex ( & box. _base, offsetBy: n )
11941177 }
11951178 fatalError ( " Index type mismatch! " )
11961179 }
@@ -1200,10 +1183,7 @@ internal final class _RandomAccessCollectionBox<S: RandomAccessCollection>
12001183 _ i: inout _AnyIndexBox , offsetBy n: Int , limitedBy limit: _AnyIndexBox
12011184 ) -> Bool {
12021185 if let box = i as? _IndexBox < S . Index > {
1203- return _base. formIndex (
1204- & box. _base,
1205- offsetBy: numericCast ( n) ,
1206- limitedBy: _unbox ( limit) )
1186+ return _base. formIndex ( & box. _base, offsetBy: n, limitedBy: _unbox ( limit) )
12071187 }
12081188 fatalError ( " Index type mismatch! " )
12091189 }
@@ -1213,12 +1193,12 @@ internal final class _RandomAccessCollectionBox<S: RandomAccessCollection>
12131193 from start: _AnyIndexBox ,
12141194 to end: _AnyIndexBox
12151195 ) -> Int {
1216- return numericCast ( _base. distance ( from: _unbox ( start) , to: _unbox ( end) ) )
1196+ return _base. distance ( from: _unbox ( start) , to: _unbox ( end) )
12171197 }
12181198
12191199 @inlinable
12201200 internal override var _count : Int {
1221- return numericCast ( _base. count)
1201+ return _base. count
12221202 }
12231203
12241204 @inlinable
0 commit comments