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 @@ -200,8 +200,9 @@ extension Substring: StringProtocol {
200
200
return _slice. distance ( from: start, to: end)
201
201
}
202
202
203
+ @inlinable
203
204
public subscript( i: Index ) -> Character {
204
- return _slice [ i]
205
+ @ inline ( __always ) get { return _slice [ i] }
205
206
}
206
207
207
208
public mutating func replaceSubrange< C> (
@@ -408,12 +409,15 @@ extension Substring.UTF8View: BidirectionalCollection {
408
409
_slice. _failEarlyRangeCheck ( range, bounds: bounds)
409
410
}
410
411
412
+ @inlinable
411
413
public func index( before i: Index ) -> Index { return _slice. index ( before: i) }
412
414
415
+ @inlinable
413
416
public func formIndex( before i: inout Index ) {
414
417
_slice. formIndex ( before: & i)
415
418
}
416
419
420
+ @inlinable
417
421
public subscript( r: Range < Index > ) -> Substring . UTF8View {
418
422
// FIXME(strings): tests.
419
423
_precondition ( r. lowerBound >= startIndex && r. upperBound <= endIndex,
@@ -810,5 +814,3 @@ extension Substring {
810
814
return Substring ( _slice [ r] )
811
815
}
812
816
}
813
-
814
-
You can’t perform that action at this time.
0 commit comments