Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stdlib: remove some inlinable annotations from Substring's and String's subscript #32812

Merged
merged 1 commit into from
Jul 16, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions stdlib/public/core/Substring.swift
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,8 @@ extension Substring: StringProtocol {
return _slice.distance(from: start, to: end)
}

@inlinable
public subscript(i: Index) -> Character {
@inline(__always) get { return _slice[i] }
get { return _slice[i] }
}

public mutating func replaceSubrange<C>(
Expand Down Expand Up @@ -322,7 +321,6 @@ extension Substring: CustomDebugStringConvertible {
}

extension Substring: LosslessStringConvertible {
@inlinable
public init(_ content: String) {
self = content[...]
}
Expand Down Expand Up @@ -800,7 +798,6 @@ extension Substring: ExpressibleByStringLiteral {

// String/Substring Slicing
extension String {
@inlinable
@available(swift, introduced: 4)
public subscript(r: Range<Index>) -> Substring {
_boundsCheck(r)
Expand All @@ -809,7 +806,6 @@ extension String {
}

extension Substring {
@inlinable
@available(swift, introduced: 4)
public subscript(r: Range<Index>) -> Substring {
return Substring(_slice[r])
Expand Down