mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-15 22:54:00 +00:00
content_archive: std::move VirtualFile in NCA's constructor
Gets rid of unnecessary atomic reference count incrementing and decrementing.
This commit is contained in:
parent
1371e2fb6a
commit
0b566f43a1
1 changed files with 4 additions and 1 deletions
|
@ -2,6 +2,9 @@
|
||||||
// Licensed under GPLv2 or any later version
|
// Licensed under GPLv2 or any later version
|
||||||
// Refer to the license.txt file included.
|
// Refer to the license.txt file included.
|
||||||
|
|
||||||
|
#include <algorithm>
|
||||||
|
#include <utility>
|
||||||
|
|
||||||
#include "common/logging/log.h"
|
#include "common/logging/log.h"
|
||||||
#include "core/file_sys/content_archive.h"
|
#include "core/file_sys/content_archive.h"
|
||||||
#include "core/file_sys/vfs_offset.h"
|
#include "core/file_sys/vfs_offset.h"
|
||||||
|
@ -61,7 +64,7 @@ struct RomFSSuperblock {
|
||||||
};
|
};
|
||||||
static_assert(sizeof(RomFSSuperblock) == 0xE8, "RomFSSuperblock has incorrect size.");
|
static_assert(sizeof(RomFSSuperblock) == 0xE8, "RomFSSuperblock has incorrect size.");
|
||||||
|
|
||||||
NCA::NCA(VirtualFile file_) : file(file_) {
|
NCA::NCA(VirtualFile file_) : file(std::move(file_)) {
|
||||||
if (sizeof(NCAHeader) != file->ReadObject(&header))
|
if (sizeof(NCAHeader) != file->ReadObject(&header))
|
||||||
LOG_CRITICAL(Loader, "File reader errored out during header read.");
|
LOG_CRITICAL(Loader, "File reader errored out during header read.");
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue