[Compression] Use max compression level for zstd
This commit is contained in:
parent
a011022da5
commit
a3df6c45da
@ -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>
|
||||
|
@ -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 "";
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user