mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
stdlib: add first argument labels and some other changes to conform to API guidelines
This commit is contained in:
@@ -775,13 +775,13 @@ internal func _transcodeSomeUTF16AsUTF8<
|
||||
// Replace it with U+FFFD.
|
||||
r = 0xbdbfef
|
||||
scalarUtf8Length = 3
|
||||
} else if _slowPath(nextIndex.advancedBy(1) == endIndex) {
|
||||
} else if _slowPath(nextIndex.advanced(by: 1) == endIndex) {
|
||||
// We have seen a high-surrogate and EOF, so we have an ill-formed
|
||||
// sequence. Replace it with U+FFFD.
|
||||
r = 0xbdbfef
|
||||
scalarUtf8Length = 3
|
||||
} else {
|
||||
let unit1 = UInt(input[nextIndex.advancedBy(1)])
|
||||
let unit1 = UInt(input[nextIndex.advanced(by: 1)])
|
||||
if _fastPath((unit1 >> 10) == 0b1101_11) {
|
||||
// `unit1` is a low-surrogate. We have a well-formed surrogate
|
||||
// pair.
|
||||
@@ -809,7 +809,7 @@ internal func _transcodeSomeUTF16AsUTF8<
|
||||
result |= numericCast(r) << shift
|
||||
utf8Count += scalarUtf8Length
|
||||
}
|
||||
nextIndex = nextIndex.advancedBy(utf16Length)
|
||||
nextIndex = nextIndex.advanced(by: utf16Length)
|
||||
}
|
||||
// FIXME: Annoying check, courtesy of <rdar://problem/16740169>
|
||||
if utf8Count < sizeofValue(result) {
|
||||
|
||||
Reference in New Issue
Block a user