file_sys: std::move std::shared_ptr instances in constructors where applicable

By default, a regular copy requires an atomic increment and decrement. A
move avoids this from occurring, which makes sense when the constructor
is taking the shared_ptr by value.
This commit is contained in:
Lioncash
2017-12-09 14:12:04 -05:00
parent af45f2b2de
commit 370d77f13a
5 changed files with 15 additions and 9 deletions

View File

@ -76,7 +76,7 @@ ResultVal<std::unique_ptr<FileBackend>> NCCHArchive::OpenFile(const Path& path,
u64 romfs_size = 0;
result = ncch_container.ReadRomFS(romfs_file, romfs_offset, romfs_size);
file = std::make_unique<IVFCFile>(romfs_file, romfs_offset, romfs_size);
file = std::make_unique<IVFCFile>(std::move(romfs_file), romfs_offset, romfs_size);
} else if (filepath_type == NCCHFilePathType::Code ||
filepath_type == NCCHFilePathType::ExeFS) {
std::vector<u8> buffer;