zlib -> libdeflate (#5085)

+ Use libdeflate
+ Use std::byte
* Fix passing temporary to string_view
+ Emulate make_unique_for_overwrite
This commit is contained in:
Tiger Wang
2021-01-11 16:39:43 +00:00
committed by GitHub
parent 00c0a23ace
commit eeb63b8901
92 changed files with 1419 additions and 2040 deletions
+2 -7
View File
@@ -1,6 +1,5 @@
#include "Globals.h"
#include "ChunkDataSerializer.h"
#include "zlib/zlib.h"
#include "Protocol_1_8.h"
#include "Protocol_1_9.h"
#include "../ClientHandle.h"
@@ -543,14 +542,10 @@ inline void cChunkDataSerializer::WriteSectionDataSeamless(const cChunkData::sCh
inline void cChunkDataSerializer::CompressPacketInto(ChunkDataCache & a_Cache)
{
m_Packet.ReadAll(a_Cache.PacketData);
m_Compressor.ReadFrom(m_Packet);
m_Packet.CommitRead();
if (!cProtocol_1_8_0::CompressPacket(a_Cache.PacketData, a_Cache.ToSend))
{
ASSERT(!"Packet compression failed.");
return;
}
cProtocol_1_8_0::CompressPacket(m_Compressor, a_Cache.ToSend);
a_Cache.Engaged = true;
}