File tree Expand file tree Collapse file tree 1 file changed +0
-21
lines changed Expand file tree Collapse file tree 1 file changed +0
-21
lines changed Original file line number Diff line number Diff line change @@ -61,27 +61,6 @@ internal func _decodeUTF8(
6161 return Unicode . Scalar ( _unchecked: value)
6262}
6363
64- internal func _decodeScalar(
65- _ utf16: UnsafeBufferPointer < UInt16 > , startingAt i: Int
66- ) -> ( Unicode . Scalar , scalarLength: Int ) {
67- let high = utf16 [ _unchecked: i]
68- if i + 1 >= utf16. count {
69- _internalInvariant ( !UTF16. isLeadSurrogate ( high) )
70- _internalInvariant ( !UTF16. isTrailSurrogate ( high) )
71- return ( Unicode . Scalar ( _unchecked: UInt32 ( high) ) , 1 )
72- }
73-
74- if !UTF16. isLeadSurrogate ( high) {
75- _internalInvariant ( !UTF16. isTrailSurrogate ( high) )
76- return ( Unicode . Scalar ( _unchecked: UInt32 ( high) ) , 1 )
77- }
78-
79- let low = utf16 [ _unchecked: i+ 1 ]
80- _internalInvariant ( UTF16 . isLeadSurrogate ( high) )
81- _internalInvariant ( UTF16 . isTrailSurrogate ( low) )
82- return ( UTF16 . _decodeSurrogates ( high, low) , 2 )
83- }
84-
8564@inlinable
8665internal func _decodeScalar(
8766 _ utf8: UnsafeBufferPointer < UInt8 > , startingAt i: Int
You can’t perform that action at this time.
0 commit comments