Skip to content

Commit 09863c6

Browse files
committed
Update for new string index inits
This change goes with swiftlang/swift#3268
1 parent 9cfa0cf commit 09863c6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Foundation/String.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,10 @@ extension String {
7474
/// Return an `Index` corresponding to the given offset in our UTF-16
7575
/// representation.
7676
func _index(_ utf16Index: Int) -> Index {
77-
return Index(_base: String.UnicodeScalarView.Index(utf16Index, _core))
77+
return Index(
78+
_base: String.UnicodeScalarView.Index(_position: utf16Index),
79+
in: characters
80+
)
7881
}
7982

8083
/// Return a `Range<Index>` corresponding to the given `NSRange` of

0 commit comments

Comments
 (0)