[Compression] Use max compression level for zstd

This commit is contained in:
momo5502 2017-06-26 20:43:52 +02:00
parent a011022da5
commit a3df6c45da
2 changed files with 3 additions and 2 deletions

View File

@ -74,7 +74,7 @@ template <size_t S> class Sizer { };
#pragma warning(disable: 6387)
// #include <zlib.h>
// #include <zstd.h>
#include <zstd.h>
#define ZWRAP_USE_ZSTD 1
#include <zstd_zlibwrapper.h>

View File

@ -17,7 +17,8 @@ namespace Utils
char* buffer = allocator.allocateArray<char>(length);
if (compress2(reinterpret_cast<Bytef*>(buffer), &length, reinterpret_cast<Bytef*>(const_cast<char*>(data.data())), data.size(), Z_BEST_COMPRESSION) != Z_OK)
int level = (ZWRAP_isUsingZSTDcompression() ? ZSTD_maxCLevel() : Z_BEST_COMPRESSION);
if (compress2(reinterpret_cast<Bytef*>(buffer), &length, reinterpret_cast<Bytef*>(const_cast<char*>(data.data())), data.size(), level) != Z_OK)
{
return "";
}