Last active
January 4, 2017 18:56
-
-
Save stevef/a84621fbde01a26c6ec6791bb83583de to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// my bad code | |
if let packetType = packet["Type"] { | |
if let nPacketType = Int(packetType) { | |
if nPacketType == 20 { | |
receivedSessionState(packet: packet, jsonBody: jsonBody) | |
} | |
} | |
} | |
// freenode better code | |
if let packetType = packet["Type"], Int(packetType) == 20 { | |
receivedSessionState(packet: packet, jsonBody: jsonBody) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment