Removed if-statement for review notes

https://github.com/socketio/socket.io-client-swift/pull/651#pullrequestreview-32616528
This commit is contained in:
musicabbage 2017-04-14 14:57:46 +08:00
parent e29c9043b2
commit 907b1b3ae2
2 changed files with 2 additions and 8 deletions

View File

@ -244,10 +244,7 @@ public final class SocketEngine : NSObject, URLSessionDelegate, SocketEnginePoll
private func createWebsocketAndConnect() {
if let oldWs = ws {
oldWs.delegate = nil
}
ws?.delegate = nil
ws = WebSocket(url: urlWebSocketWithSid as URL)
if cookies != nil {

View File

@ -120,10 +120,7 @@ public final class SocketIOClient : NSObject, SocketEngineClient, SocketParsable
private func addEngine() -> SocketEngineSpec {
DefaultSocketLogger.Logger.log("Adding engine", type: logType, args: "")
if let oldEngine = engine {
oldEngine.client = nil
}
engine?.client = nil
engine = SocketEngine(client: self, url: socketURL, config: config)
return engine!