From b0075966afb2350c037b481ab207dcf10bffdf6f Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 24 May 2015 22:53:25 -0400 Subject: [PATCH] NetPlayClient: Remove unnecessary array allocation --- Source/Core/Core/NetPlayClient.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Source/Core/Core/NetPlayClient.cpp b/Source/Core/Core/NetPlayClient.cpp index 0a31866170..4792a18112 100644 --- a/Source/Core/Core/NetPlayClient.cpp +++ b/Source/Core/Core/NetPlayClient.cpp @@ -339,11 +339,9 @@ unsigned int NetPlayClient::OnData(sf::Packet& packet) packet >> map >> size; nw.resize(size); - u8* data = new u8[size]; + for (unsigned int i = 0; i < size; ++i) - packet >> data[i]; - nw.assign(data, data + size); - delete[] data; + packet >> nw[i]; // trusting server for good map value (>=0 && <4) // add to Wiimote buffer