diff options
author | Lioncash <mathew1800@gmail.com> | 2018-10-03 01:50:59 -0400 |
---|---|---|
committer | Lioncash <mathew1800@gmail.com> | 2018-10-03 01:51:01 -0400 |
commit | 02841052aa5e2126089268f465858fff379577d8 (patch) | |
tree | f739454355d27fc8d65d430289f94a0b92c73bd4 /src | |
parent | 37ee05f7c0f1fa8d94317e92795016e91f1bdfa6 (diff) |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/core/file_sys/submission_package.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/core/file_sys/submission_package.cpp b/src/core/file_sys/submission_package.cpp index d39b79edd..c3848e826 100644 --- a/src/core/file_sys/submission_package.cpp +++ b/src/core/file_sys/submission_package.cpp @@ -207,7 +207,7 @@ void NSP::InitializeExeFSAndRomFS(const std::vector<VirtualFile>& files) { exefs = pfs; 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()) { |