mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[String] Refactor helper code into UnicodeHelpers.swift.
Clean up some of the index assumptions, stick index-aware methods on _StringGuts, and otherwise migrate code over to UnicodeHelpers.swift.
This commit is contained in:
@@ -341,3 +341,17 @@ extension _StringGuts {
|
||||
}
|
||||
}
|
||||
|
||||
// Index
|
||||
extension _StringGuts {
|
||||
@usableFromInline
|
||||
internal typealias Index = String.Index
|
||||
|
||||
@inlinable
|
||||
internal var startIndex: String.Index {
|
||||
@inline(__always) get { return Index(encodedOffset: 0) }
|
||||
}
|
||||
@inlinable
|
||||
internal var endIndex: String.Index {
|
||||
@inline(__always) get { return Index(encodedOffset: self.count) }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user