use while let instead of while and if let
This commit is contained in:
parent
a3d443268a
commit
d632135289
@ -109,14 +109,11 @@ public extension SocketParsable where Self: SocketManagerSpec & SocketDataBuffer
|
|||||||
if type == .error {
|
if type == .error {
|
||||||
reader.advance(by: -1)
|
reader.advance(by: -1)
|
||||||
} else {
|
} else {
|
||||||
while reader.hasNext {
|
while let int = Int(reader.read(count: 1)) {
|
||||||
if let int = Int(reader.read(count: 1)) {
|
idString += String(int)
|
||||||
idString += String(int)
|
|
||||||
} else {
|
|
||||||
reader.advance(by: -2)
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
reader.advance(by: -2)
|
||||||
}
|
}
|
||||||
|
|
||||||
var dataArray = String(message.utf16[message.utf16.index(reader.currentIndex, offsetBy: 1)...])!
|
var dataArray = String(message.utf16[message.utf16.index(reader.currentIndex, offsetBy: 1)...])!
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user