Skip to content

Commit fbba722

Browse files
committed
stdlib: replace _ascii8() with UInt8(ascii:)
1 parent d8bb5ef commit fbba722

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed

stdlib/public/core/InputStream.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ public func readLine(strippingNewline: Bool = true) -> String? {
4242
// <rdar://problem/20013999> Recognize Unicode newlines in readLine()
4343
//
4444
// Recognize only LF and CR+LF combinations for now.
45-
let cr = CChar(_ascii8("\r"))
46-
let lf = CChar(_ascii8("\n"))
45+
let cr = CChar(UInt8(ascii: "\r"))
46+
let lf = CChar(UInt8(ascii: "\n"))
4747
if readBytes == 1 && linePtr[0] == lf {
4848
return ""
4949
}

stdlib/public/core/UnicodeScalar.swift

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -267,14 +267,6 @@ extension UnicodeScalar.UTF16View : RandomAccessCollection {
267267
}
268268
}
269269

270-
/// Returns c as a UTF8.CodeUnit. Meant to be used as _ascii8("x").
271-
@warn_unused_result
272-
public // SPI(SwiftExperimental)
273-
func _ascii8(_ c: UnicodeScalar) -> UTF8.CodeUnit {
274-
_sanityCheck(c.value >= 0 && c.value <= 0x7F, "not ASCII")
275-
return UTF8.CodeUnit(c.value)
276-
}
277-
278270
/// Returns c as a UTF16.CodeUnit. Meant to be used as _ascii16("x").
279271
@warn_unused_result
280272
public // SPI(SwiftExperimental)

0 commit comments

Comments
 (0)