summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2018-01-18 05:52:40 +0100
committerGitHub <noreply@github.com>2018-01-18 05:52:40 +0100
commitcf0daed0b810b2cb5c3643609bf9b569be2eee20 (patch)
tree987f60b1903c5a0a32147931a9e18003e2efc8f1
parentMerge pull request #88 from lioncash/include (diff)
parentvi: Copy data directly into the std::vector within Parcel's ReadBlock function (diff)
downloadyuzu-cf0daed0b810b2cb5c3643609bf9b569be2eee20.tar
yuzu-cf0daed0b810b2cb5c3643609bf9b569be2eee20.tar.gz
yuzu-cf0daed0b810b2cb5c3643609bf9b569be2eee20.tar.bz2
yuzu-cf0daed0b810b2cb5c3643609bf9b569be2eee20.tar.lz
yuzu-cf0daed0b810b2cb5c3643609bf9b569be2eee20.tar.xz
yuzu-cf0daed0b810b2cb5c3643609bf9b569be2eee20.tar.zst
yuzu-cf0daed0b810b2cb5c3643609bf9b569be2eee20.zip
-rw-r--r--src/core/hle/service/vi/vi.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/core/hle/service/vi/vi.cpp b/src/core/hle/service/vi/vi.cpp
index cae2c4466..57ad4c59c 100644
--- a/src/core/hle/service/vi/vi.cpp
+++ b/src/core/hle/service/vi/vi.cpp
@@ -47,8 +47,9 @@ public:
}
std::vector<u8> ReadBlock(size_t length) {
- std::vector<u8> data(length);
- std::memcpy(data.data(), buffer.data() + read_index, length);
+ const u8* const begin = buffer.data() + read_index;
+ const u8* const end = begin + length;
+ std::vector<u8> data(begin, end);
read_index += length;
read_index = Common::AlignUp(read_index, 4);
return data;