diff options
author | Lioncash <mathew1800@gmail.com> | 2020-08-14 09:38:45 -0400 |
---|---|---|
committer | Lioncash <mathew1800@gmail.com> | 2020-08-15 17:17:52 -0400 |
commit | df7248039553b3ebd338380c3ef0428b0e046e79 (patch) | |
tree | eca7153300e311ac7954f5c085fdada0c7295699 /src/common/zstd_compression.h | |
parent | 2b601e86360ea47df5b3cb1a280177f428763837 (diff) |
common: Make use of [[nodiscard]] where applicable
Now that clang-format makes [[nodiscard]] attributes format sensibly, we
can apply them to several functions within the common library to allow
the compiler to complain about any misuses of the functions.
Diffstat (limited to 'src/common/zstd_compression.h')
-rw-r--r-- | src/common/zstd_compression.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/common/zstd_compression.h b/src/common/zstd_compression.h index b5edf19e7..4bacf8355 100644 --- a/src/common/zstd_compression.h +++ b/src/common/zstd_compression.h @@ -19,7 +19,7 @@ namespace Common::Compression { * * @return the compressed data. */ -std::vector<u8> CompressDataZSTD(std::span<const u8> source, s32 compression_level); +[[nodiscard]] std::vector<u8> CompressDataZSTD(std::span<const u8> source, s32 compression_level); /** * Compresses a source memory region with Zstandard with the default compression level and returns @@ -29,7 +29,7 @@ std::vector<u8> CompressDataZSTD(std::span<const u8> source, s32 compression_lev * * @return the compressed data. */ -std::vector<u8> CompressDataZSTDDefault(std::span<const u8> source); +[[nodiscard]] std::vector<u8> CompressDataZSTDDefault(std::span<const u8> source); /** * Decompresses a source memory region with Zstandard and returns the uncompressed data in a vector. @@ -38,6 +38,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 |