use new if let
This commit is contained in:
parent
59e068c853
commit
27a767746b
|
|
@ -103,11 +103,11 @@ class SocketParser {
|
|||
}
|
||||
}
|
||||
|
||||
if buf.toInt() == nil || arr[i] != "-" {
|
||||
if let holders = buf.toInt() where arr[i] == "-" {
|
||||
placeholders = holders
|
||||
} else {
|
||||
NSLog("Error parsing \(str)")
|
||||
return nil
|
||||
} else {
|
||||
placeholders = buf.toInt()!
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue