File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -199,8 +199,9 @@ extension Substring: StringProtocol {
199
199
return _slice. distance ( from: start, to: end)
200
200
}
201
201
202
+ @inlinable
202
203
public subscript( i: Index ) -> Character {
203
- return _slice [ i]
204
+ @ inline ( __always ) get { return _slice [ i] }
204
205
}
205
206
206
207
public mutating func replaceSubrange< C> (
@@ -402,12 +403,15 @@ extension Substring.UTF8View : BidirectionalCollection {
402
403
_slice. _failEarlyRangeCheck ( range, bounds: bounds)
403
404
}
404
405
406
+ @inlinable
405
407
public func index( before i: Index ) -> Index { return _slice. index ( before: i) }
406
408
409
+ @inlinable
407
410
public func formIndex( before i: inout Index ) {
408
411
_slice. formIndex ( before: & i)
409
412
}
410
413
414
+ @inlinable
411
415
public subscript( r: Range < Index > ) -> Substring . UTF8View {
412
416
// FIXME(strings): tests.
413
417
_precondition ( r. lowerBound >= startIndex && r. upperBound <= endIndex,
@@ -804,5 +808,3 @@ extension Substring {
804
808
return Substring ( _slice [ r] )
805
809
}
806
810
}
807
-
808
-
You can’t perform that action at this time.
0 commit comments