mirror of
https://github.com/GayPizzaSpecifications/darwin-apk.git
synced 2026-11-05 02:42:21 +00:00
Faster UTF8 decode
This commit is contained in:
1 parent
ff38a831f2
commit
c7185fa370
2 files changed
+2
-3
No files matched your search
@@ -74,7 +74,7 @@ struct TextInputStream<InStream: InputStream> where InStream.Element == UInt8 {
|
||||
|
||||
if _fastPath(!self._bytes.isEmpty) {
|
||||
// Convert and return line
|
||||
return String(bytes: self._bytes, encoding: .utf8)
|
||||
return String(decoding: self._bytes, as: UTF8.self)
|
||||
} else {
|
||||
if _fastPath(!self._eof) {
|
||||
// Don't bother decoding empty lines and just return an empty string
|
||||
|
||||
Reference in new issue
Block a user