From aeb52de72f88b32e43b4b38e349ffebffbbee80c Mon Sep 17 00:00:00 2001 From: Erik Date: Fri, 25 Dec 2015 11:28:08 -0500 Subject: [PATCH] don't need to keep count manually --- Source/SocketPacket.swift | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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 {