Skip to content

Commit ab5e810

Browse files
authored
Merge pull request swiftlang#32812 from eeckstein/no-subscript-inlining
stdlib: remove some inlinable annotations from Substring's and String's subscript
2 parents 6687fca + 0102fe8 commit ab5e810

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

stdlib/public/core/Substring.swift

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -200,9 +200,8 @@ extension Substring: StringProtocol {
200200
return _slice.distance(from: start, to: end)
201201
}
202202

203-
@inlinable
204203
public subscript(i: Index) -> Character {
205-
@inline(__always) get { return _slice[i] }
204+
get { return _slice[i] }
206205
}
207206

208207
public mutating func replaceSubrange<C>(
@@ -322,7 +321,6 @@ extension Substring: CustomDebugStringConvertible {
322321
}
323322

324323
extension Substring: LosslessStringConvertible {
325-
@inlinable
326324
public init(_ content: String) {
327325
self = content[...]
328326
}
@@ -800,7 +798,6 @@ extension Substring: ExpressibleByStringLiteral {
800798

801799
// String/Substring Slicing
802800
extension String {
803-
@inlinable
804801
@available(swift, introduced: 4)
805802
public subscript(r: Range<Index>) -> Substring {
806803
_boundsCheck(r)
@@ -809,7 +806,6 @@ extension String {
809806
}
810807

811808
extension Substring {
812-
@inlinable
813809
@available(swift, introduced: 4)
814810
public subscript(r: Range<Index>) -> Substring {
815811
return Substring(_slice[r])

0 commit comments

Comments
 (0)