From 563199698dedeec473108d1c333a2a0d88e541d1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Lo=C3=AFc=20Blot?= Date: Tue, 4 Apr 2017 07:47:04 +0200 Subject: [PATCH] Client handlers: Remove useless stringstream usage in two handlers (#5510) --- src/network/clientpackethandler.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/network/clientpackethandler.cpp b/src/network/clientpackethandler.cpp index dfaebbe53..19f8bbf58 100644 --- a/src/network/clientpackethandler.cpp +++ b/src/network/clientpackethandler.cpp @@ -733,9 +733,7 @@ void Client::handleCommand_NodeDef(NetworkPacket* pkt) sanity_check(!m_mesh_update_thread.isRunning()); // Decompress node definitions - std::string datastring(pkt->getString(0), pkt->getSize()); - std::istringstream is(datastring, std::ios_base::binary); - std::istringstream tmp_is(deSerializeLongString(is), std::ios::binary); + std::istringstream tmp_is(pkt->readLongString(), std::ios::binary); std::ostringstream tmp_os; decompressZlib(tmp_is, tmp_os); @@ -760,9 +758,7 @@ void Client::handleCommand_ItemDef(NetworkPacket* pkt) sanity_check(!m_mesh_update_thread.isRunning()); // Decompress item definitions - std::string datastring(pkt->getString(0), pkt->getSize()); - std::istringstream is(datastring, std::ios_base::binary); - std::istringstream tmp_is(deSerializeLongString(is), std::ios::binary); + std::istringstream tmp_is(pkt->readLongString(), std::ios::binary); std::ostringstream tmp_os; decompressZlib(tmp_is, tmp_os); -- 2.25.1