Skip to content

Commit 27a7677

Browse files
committed
use new if let
1 parent 59e068c commit 27a7677

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

SocketIOClientSwift/SocketParser.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,11 @@ class SocketParser {
103103
}
104104
}
105105

106-
if buf.toInt() == nil || arr[i] != "-" {
106+
if let holders = buf.toInt() where arr[i] == "-" {
107+
placeholders = holders
108+
} else {
107109
NSLog("Error parsing \(str)")
108110
return nil
109-
} else {
110-
placeholders = buf.toInt()!
111111
}
112112
}
113113

0 commit comments

Comments
 (0)