diff options
| author | 2018-07-18 23:12:14 -0400 | |
|---|---|---|
| committer | 2018-07-18 23:13:25 -0400 | |
| commit | 0b566f43a1f49121c0e4a9950a71319d60adccef (patch) | |
| tree | 6381f046787c10fc21f8e5d6f686044b992ee85a /src | |
| parent | Merge pull request #691 from lioncash/guard (diff) | |
| download | yuzu-0b566f43a1f49121c0e4a9950a71319d60adccef.tar.gz yuzu-0b566f43a1f49121c0e4a9950a71319d60adccef.tar.xz yuzu-0b566f43a1f49121c0e4a9950a71319d60adccef.zip | |
content_archive: std::move VirtualFile in NCA's constructor
Gets rid of unnecessary atomic reference count incrementing and
decrementing.
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/file_sys/content_archive.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/core/file_sys/content_archive.cpp b/src/core/file_sys/content_archive.cpp index 6cfef774d..d6b20c047 100644 --- a/src/core/file_sys/content_archive.cpp +++ b/src/core/file_sys/content_archive.cpp | |||
| @@ -2,6 +2,9 @@ | |||
| 2 | // Licensed under GPLv2 or any later version | 2 | // Licensed under GPLv2 or any later version |
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include <algorithm> | ||
| 6 | #include <utility> | ||
| 7 | |||
| 5 | #include "common/logging/log.h" | 8 | #include "common/logging/log.h" |
| 6 | #include "core/file_sys/content_archive.h" | 9 | #include "core/file_sys/content_archive.h" |
| 7 | #include "core/file_sys/vfs_offset.h" | 10 | #include "core/file_sys/vfs_offset.h" |
| @@ -61,7 +64,7 @@ struct RomFSSuperblock { | |||
| 61 | }; | 64 | }; |
| 62 | static_assert(sizeof(RomFSSuperblock) == 0xE8, "RomFSSuperblock has incorrect size."); | 65 | static_assert(sizeof(RomFSSuperblock) == 0xE8, "RomFSSuperblock has incorrect size."); |
| 63 | 66 | ||
| 64 | NCA::NCA(VirtualFile file_) : file(file_) { | 67 | NCA::NCA(VirtualFile file_) : file(std::move(file_)) { |
| 65 | if (sizeof(NCAHeader) != file->ReadObject(&header)) | 68 | if (sizeof(NCAHeader) != file->ReadObject(&header)) |
| 66 | LOG_CRITICAL(Loader, "File reader errored out during header read."); | 69 | LOG_CRITICAL(Loader, "File reader errored out during header read."); |
| 67 | 70 | ||