mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Change the meaning of "if let x = foo()" back to Xcode 6.4 semantics. The compiler
includes a number of QoI things to help people write the correct code. I will commit the testcase for it as the next patch. The bulk of this patch is moving the stdlib, testsuite and validation testsuite to the new syntax. I moved a few uses of "as" patterns back to as? expressions in the stdlib as well. Swift SVN r27959
This commit is contained in:
@@ -337,7 +337,7 @@ public struct UTF8 : UnicodeCodecType {
|
||||
if _lookaheadFlags & 0b1111_0000 == 0 {
|
||||
// Add more bytes into the buffer until we have 4.
|
||||
while _lookaheadFlags != 0b0000_1111 {
|
||||
if let codeUnit? = next.next() {
|
||||
if let codeUnit = next.next() {
|
||||
_decodeLookahead = (_decodeLookahead << 8) | UInt32(codeUnit)
|
||||
_lookaheadFlags = (_lookaheadFlags << 1) | 1
|
||||
} else {
|
||||
@@ -526,7 +526,7 @@ public struct UTF16 : UnicodeCodecType {
|
||||
|
||||
var unit0: UInt32
|
||||
if _fastPath(_lookaheadFlags & 0b10 == 0) {
|
||||
if let first? = input.next() {
|
||||
if let first = input.next() {
|
||||
unit0 = UInt32(first)
|
||||
} else {
|
||||
// Set EOF flag.
|
||||
@@ -556,7 +556,7 @@ public struct UTF16 : UnicodeCodecType {
|
||||
// At this point we know that `unit0` is a high-surrogate.
|
||||
|
||||
var unit1: UInt32
|
||||
if let second? = input.next() {
|
||||
if let second = input.next() {
|
||||
unit1 = UInt32(second)
|
||||
} else {
|
||||
// EOF reached. Set EOF flag.
|
||||
|
||||
Reference in New Issue
Block a user