don't check type on each pass through loop
This commit is contained in:
parent
ff48d3a186
commit
0564ded492
@ -96,9 +96,8 @@ extension SocketParsable {
|
|||||||
|
|
||||||
if type == .Error {
|
if type == .Error {
|
||||||
parser.advanceIndexBy(-1)
|
parser.advanceIndexBy(-1)
|
||||||
}
|
} else {
|
||||||
|
while parser.hasNext {
|
||||||
while parser.hasNext && type != .Error {
|
|
||||||
if let int = Int(parser.read(1)) {
|
if let int = Int(parser.read(1)) {
|
||||||
idString += String(int)
|
idString += String(int)
|
||||||
} else {
|
} else {
|
||||||
@ -106,6 +105,7 @@ extension SocketParsable {
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
let d = message[parser.currentIndex.advancedBy(1)..<message.endIndex]
|
let d = message[parser.currentIndex.advancedBy(1)..<message.endIndex]
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user