summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2021-05-24 11:32:32 +0200
committerLioncash <mathew1800@gmail.com>2021-05-24 21:01:04 +0200
commit49bfd0c46145b8f69e52077b83278038d514caf4 (patch)
treebc7a1a88592b486641571be8997ce9357275b4c2
parentlz4_compression: Make use of std::span (diff)
downloadyuzu-49bfd0c46145b8f69e52077b83278038d514caf4.tar
yuzu-49bfd0c46145b8f69e52077b83278038d514caf4.tar.gz
yuzu-49bfd0c46145b8f69e52077b83278038d514caf4.tar.bz2
yuzu-49bfd0c46145b8f69e52077b83278038d514caf4.tar.lz
yuzu-49bfd0c46145b8f69e52077b83278038d514caf4.tar.xz
yuzu-49bfd0c46145b8f69e52077b83278038d514caf4.tar.zst
yuzu-49bfd0c46145b8f69e52077b83278038d514caf4.zip
-rw-r--r--src/common/zstd_compression.cpp2
-rw-r--r--src/common/zstd_compression.h5
2 files changed, 4 insertions, 3 deletions
diff --git a/src/common/zstd_compression.cpp b/src/common/zstd_compression.cpp
index 5f45459da..695b96a43 100644
--- a/src/common/zstd_compression.cpp
+++ b/src/common/zstd_compression.cpp
@@ -32,7 +32,7 @@ std::vector<u8> CompressDataZSTDDefault(const u8* source, std::size_t source_siz
return CompressDataZSTD(source, source_size, ZSTD_CLEVEL_DEFAULT);
}
-std::vector<u8> DecompressDataZSTD(const std::vector<u8>& compressed) {
+std::vector<u8> DecompressDataZSTD(std::span<const u8> compressed) {
const std::size_t decompressed_size =
ZSTD_getDecompressedSize(compressed.data(), compressed.size());
std::vector<u8> decompressed(decompressed_size);
diff --git a/src/common/zstd_compression.h b/src/common/zstd_compression.h
index c26a30ab9..bbce14f4e 100644
--- a/src/common/zstd_compression.h
+++ b/src/common/zstd_compression.h
@@ -4,6 +4,7 @@
#pragma once
+#include <span>
#include <vector>
#include "common/common_types.h"
@@ -40,6 +41,6 @@ namespace Common::Compression {
*
* @return the decompressed data.
*/
-[[nodiscard]] std::vector<u8> DecompressDataZSTD(const std::vector<u8>& compressed);
+[[nodiscard]] std::vector<u8> DecompressDataZSTD(std::span<const u8> compressed);
-} // namespace Common::Compression \ No newline at end of file
+} // namespace Common::Compression