File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -64,7 +64,7 @@ internal func _decodeUTF8(
64
64
internal func _decodeScalar(
65
65
_ utf16: UnsafeBufferPointer < UInt16 > , startingAt i: Int
66
66
) -> ( Unicode . Scalar , scalarLength: Int ) {
67
- let high = utf16 [ i]
67
+ let high = utf16 [ _unchecked : i]
68
68
if i + 1 >= utf16. count {
69
69
_internalInvariant ( !UTF16. isLeadSurrogate ( high) )
70
70
_internalInvariant ( !UTF16. isTrailSurrogate ( high) )
@@ -76,7 +76,7 @@ internal func _decodeScalar(
76
76
return ( Unicode . Scalar ( _unchecked: UInt32 ( high) ) , 1 )
77
77
}
78
78
79
- let low = utf16 [ i+ 1 ]
79
+ let low = utf16 [ _unchecked : i+ 1 ]
80
80
_internalInvariant ( UTF16 . isLeadSurrogate ( high) )
81
81
_internalInvariant ( UTF16 . isTrailSurrogate ( low) )
82
82
return ( UTF16 . _decodeSurrogates ( high, low) , 2 )
@@ -207,7 +207,7 @@ extension _StringGuts {
207
207
@inlinable
208
208
internal func fastUTF8ScalarLength( startingAt i: Int ) -> Int {
209
209
_internalInvariant ( isFastUTF8)
210
- let len = _utf8ScalarLength ( self . withFastUTF8 { $0 [ i] } )
210
+ let len = _utf8ScalarLength ( self . withFastUTF8 { $0 [ _unchecked : i] } )
211
211
_internalInvariant ( ( 1 ... 4 ) ~= len)
212
212
return len
213
213
}
You can’t perform that action at this time.
0 commit comments