mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[stdlib] Remove _StringCore reference from UnicodeScalarIndex
This removes the `_core` property from UnicodeScalarView.Index and moves any remaining index-moving logic from the index to the view in UnicodeScalarView and CharacterView.
This commit is contained in:
@@ -96,7 +96,10 @@ extension String {
|
||||
/// Return an `Index` corresponding to the given offset in our UTF-16
|
||||
/// representation.
|
||||
func _index(_ utf16Index: Int) -> Index {
|
||||
return Index(_base: String.UnicodeScalarView.Index(utf16Index, _core))
|
||||
return Index(
|
||||
_base: String.UnicodeScalarView.Index(_position: utf16Index),
|
||||
in: characters
|
||||
)
|
||||
}
|
||||
|
||||
/// Return a `Range<Index>` corresponding to the given `NSRange` of
|
||||
|
||||
Reference in New Issue
Block a user