service: Resolve trivially avoidable copies (#5237)

* am/am: Avoid redundant copy in GetProgramInfoFromCia()

We can just use a reference to the title metadata. Avoids copying
several data entries and std::vector instances that don't need to be
copied.

* hle/service: Avoid redundant copying of std::string

GetUserPath() returns the path as a reference, so we can make use of
said reference to avoid making copies.
This commit is contained in:
Mat M 2020-04-19 03:24:37 -04:00 committed by GitHub
parent e54b640e0b
commit 8014c67faa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 22 additions and 18 deletions

View file

@ -555,7 +555,7 @@ ResultCode Module::FormatConfig() {
} // namespace Service::CFG
ResultCode Module::LoadConfigNANDSaveFile() {
std::string nand_directory = FileUtil::GetUserPath(FileUtil::UserPath::NANDDir);
const std::string& nand_directory = FileUtil::GetUserPath(FileUtil::UserPath::NANDDir);
FileSys::ArchiveFactory_SystemSaveData systemsavedata_factory(nand_directory);
// Open the SystemSaveData archive 0x00010017