Skip to content

Commit 512b499

Browse files
committed
Issue #59903 - Removing _decodeScalar function that isn't being used
1 parent a620288 commit 512b499

File tree

1 file changed

+0
-21
lines changed

1 file changed

+0
-21
lines changed

stdlib/public/core/UnicodeHelpers.swift

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff 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
8665
internal func _decodeScalar(
8766
_ utf8: UnsafeBufferPointer<UInt8>, startingAt i: Int

0 commit comments

Comments
 (0)