2
1
Fork 0
mirror of https://github.com/yuzu-emu/yuzu.git synced 2024-07-04 23:31:19 +01:00

submission_package: Use std::string's rfind() when looking for the extension in InitializeExeFSAndRomFS()

When searching for a file extension, it's generally preferable to begin
the search at the end of the string rather than the beginning, as the
whole string isn't going to be walked just to check for something at the
end of it.
This commit is contained in:
Lioncash 2018-10-03 01:50:59 -04:00
parent 37ee05f7c0
commit 02841052aa

View file

@ -207,7 +207,7 @@ void NSP::InitializeExeFSAndRomFS(const std::vector<VirtualFile>& files) {
exefs = pfs; exefs = pfs;
const auto romfs_iter = std::find_if(files.begin(), files.end(), [](const VirtualFile& file) { const auto romfs_iter = std::find_if(files.begin(), files.end(), [](const VirtualFile& file) {
return file->GetName().find(".romfs") != std::string::npos; return file->GetName().rfind(".romfs") != std::string::npos;
}); });
if (romfs_iter == files.end()) { if (romfs_iter == files.end()) {