aboutsummaryrefslogtreecommitdiff
path: root/src/network
diff options
context:
space:
mode:
authorLoïc Blot <nerzhul@users.noreply.github.com>2017-04-04 07:47:04 +0200
committerGitHub <noreply@github.com>2017-04-04 07:47:04 +0200
commit563199698dedeec473108d1c333a2a0d88e541d1 (patch)
treee185d687019171d1bace2c2d65443216266841d8 /src/network
parent000ec260017256016b62bb9936bbda1ff969e252 (diff)
downloadminetest-563199698dedeec473108d1c333a2a0d88e541d1.tar.gz
minetest-563199698dedeec473108d1c333a2a0d88e541d1.tar.bz2
minetest-563199698dedeec473108d1c333a2a0d88e541d1.zip
Client handlers: Remove useless stringstream usage in two handlers (#5510)
Diffstat (limited to 'src/network')
-rw-r--r--src/network/clientpackethandler.cpp8
1 files 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);