[stdlib] Minor refactor for clarity in UTF8.decode()

This commit is contained in:
Patrick Pijnappel
2016-03-05 11:01:54 +11:00
parent c109bb2a19
commit 636423c4ec

View File

@@ -119,10 +119,10 @@ public struct UTF8 : UnicodeCodecType {
if let codeUnit = next.next() {
if codeUnit & 0x80 == 0 {
return .Result(UnicodeScalar(_unchecked: UInt32(codeUnit)))
} else { // Non-ASCII, switch to buffering mode.
_decodeBuffer = UInt32(codeUnit)
_bitsInBuffer = 8
}
// Non-ASCII, proceed to buffering mode.
_decodeBuffer = UInt32(codeUnit)
_bitsInBuffer = 8
} else {
_didExhaustGenerator = true
return .EmptyInput