diff --git a/Source/SocketPacket.swift b/Source/SocketPacket.swift index 3373503..61bc753 100644 --- a/Source/SocketPacket.swift +++ b/Source/SocketPacket.swift @@ -27,7 +27,6 @@ import Foundation struct SocketPacket { private let placeholders: Int - private var currentPlace = 0 private static let logType = "SocketPacket" @@ -73,14 +72,13 @@ struct SocketPacket { } mutating func addData(data: NSData) -> Bool { - if placeholders == currentPlace { + if placeholders == binary.count { return true } binary.append(data) - currentPlace += 1 - if placeholders == currentPlace { + if placeholders == binary.count { fillInPlaceholders() return true } else {