diff options
| author | 2018-01-17 23:52:40 -0500 | |
|---|---|---|
| committer | 2018-01-17 23:52:40 -0500 | |
| commit | cf0daed0b810b2cb5c3643609bf9b569be2eee20 (patch) | |
| tree | 987f60b1903c5a0a32147931a9e18003e2efc8f1 /src | |
| parent | Merge pull request #88 from lioncash/include (diff) | |
| parent | vi: Copy data directly into the std::vector within Parcel's ReadBlock function (diff) | |
| download | yuzu-cf0daed0b810b2cb5c3643609bf9b569be2eee20.tar.gz yuzu-cf0daed0b810b2cb5c3643609bf9b569be2eee20.tar.xz yuzu-cf0daed0b810b2cb5c3643609bf9b569be2eee20.zip | |
Merge pull request #89 from lioncash/vi-vector
vi: Copy data directly into the std::vector within Parcel's ReadBlock function
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/hle/service/vi/vi.cpp | 5 |
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: | |||
| 47 | } | 47 | } |
| 48 | 48 | ||
| 49 | std::vector<u8> ReadBlock(size_t length) { | 49 | std::vector<u8> ReadBlock(size_t length) { |
| 50 | std::vector<u8> data(length); | 50 | const u8* const begin = buffer.data() + read_index; |
| 51 | std::memcpy(data.data(), buffer.data() + read_index, length); | 51 | const u8* const end = begin + length; |
| 52 | std::vector<u8> data(begin, end); | ||
| 52 | read_index += length; | 53 | read_index += length; |
| 53 | read_index = Common::AlignUp(read_index, 4); | 54 | read_index = Common::AlignUp(read_index, 4); |
| 54 | return data; | 55 | return data; |