From 33f6cc246e39924b9c1131185fde355388d3d092 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Mon, 29 Jul 2024 22:06:19 +1000 Subject: [PATCH] System: Use default compression level I'd intended to make this an option. --- src/core/system.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/system.cpp b/src/core/system.cpp index 05184d5d5..2cf57ecca 100644 --- a/src/core/system.cpp +++ b/src/core/system.cpp @@ -2995,7 +2995,7 @@ u32 System::CompressAndWriteStateData(std::FILE* fp, std::span src, Sa uLongf compressed_size = static_cast(buffer_size); const int err = - compress2(buffer.data(), &compressed_size, src.data(), static_cast(src.size()), Z_BEST_COMPRESSION); + compress2(buffer.data(), &compressed_size, src.data(), static_cast(src.size()), Z_DEFAULT_COMPRESSION); if (err != Z_OK) [[unlikely]] { Error::SetStringFmt(error, "compress2() failed: {}", err); @@ -3009,7 +3009,7 @@ u32 System::CompressAndWriteStateData(std::FILE* fp, std::span src, Sa const size_t buffer_size = ZSTD_compressBound(src.size()); buffer.resize(buffer_size); - const size_t compressed_size = ZSTD_compress(buffer.data(), buffer_size, src.data(), src.size(), 19); + const size_t compressed_size = ZSTD_compress(buffer.data(), buffer_size, src.data(), src.size(), 0); if (ZSTD_isError(compressed_size)) [[unlikely]] { const char* errstr = ZSTD_getErrorString(ZSTD_getErrorCode(compressed_size));