Skip to content

Commit 5983561

Browse files
authored
Merge pull request #430 from natecook1000/nc-scalarindex-nocore
Update for new string index inits
2 parents e877546 + 09863c6 commit 5983561

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)