diff options
Diffstat (limited to 'src/common/zstd_compression.h')
-rw-r--r-- | src/common/zstd_compression.h | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/common/zstd_compression.h b/src/common/zstd_compression.h index b5edf19e7..c26a30ab9 100644 --- a/src/common/zstd_compression.h +++ b/src/common/zstd_compression.h @@ -4,7 +4,6 @@ #pragma once -#include <span> #include <vector> #include "common/common_types.h" @@ -14,22 +13,25 @@ namespace Common::Compression { /** * Compresses a source memory region with Zstandard and returns the compressed data in a vector. * - * @param source the uncompressed source memory region. - * @param compression_level the used compression level. Should be between 1 and 22. + * @param source The uncompressed source memory region. + * @param source_size The size of the uncompressed source memory region. + * @param compression_level The used compression level. Should be between 1 and 22. * * @return the compressed data. */ -std::vector<u8> CompressDataZSTD(std::span<const u8> source, s32 compression_level); +[[nodiscard]] std::vector<u8> CompressDataZSTD(const u8* source, std::size_t source_size, + s32 compression_level); /** * Compresses a source memory region with Zstandard with the default compression level and returns * the compressed data in a vector. * - * @param source the uncompressed source memory region. + * @param source The uncompressed source memory region. + * @param source_size The size of the uncompressed source memory region. * * @return the compressed data. */ -std::vector<u8> CompressDataZSTDDefault(std::span<const u8> source); +[[nodiscard]] std::vector<u8> CompressDataZSTDDefault(const u8* source, std::size_t source_size); /** * Decompresses a source memory region with Zstandard and returns the uncompressed data in a vector. @@ -38,6 +40,6 @@ std::vector<u8> CompressDataZSTDDefault(std::span<const u8> source); * * @return the decompressed data. */ -std::vector<u8> DecompressDataZSTD(const std::vector<u8>& compressed); +[[nodiscard]] std::vector<u8> DecompressDataZSTD(const std::vector<u8>& compressed); } // namespace Common::Compression
\ No newline at end of file |