refactoring

This commit is contained in:
Erik 2016-05-06 12:48:33 -04:00
parent 9747cc4ddc
commit 98063c8bf7
2 changed files with 2 additions and 5 deletions

View File

@ -61,7 +61,7 @@ struct SocketPacket {
return createPacketString()
}
init(type: SocketPacket.PacketType, data: [AnyObject] = [AnyObject](), id: Int = -1,
init(type: PacketType, data: [AnyObject] = [AnyObject](), id: Int = -1,
nsp: String, placeholders: Int = 0, binary: [NSData] = [NSData]()) {
self.data = data
self.id = id

View File

@ -35,8 +35,6 @@ extension SocketParsable {
private func handleConnect(p: SocketPacket) {
if p.nsp == "/" && nsp != "/" {
joinNamespace(nsp)
} else if p.nsp != "/" && nsp == "/" {
didConnect()
} else {
didConnect()
}
@ -91,8 +89,7 @@ extension SocketParsable {
}
if !parser.hasNext {
return .Right(SocketPacket(type: type, id: -1,
nsp: namespace ?? "/", placeholders: placeholders))
return .Right(SocketPacket(type: type, nsp: namespace, placeholders: placeholders))
}
var idString = ""