summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2018-10-03 01:50:59 -0400
committerLioncash <mathew1800@gmail.com>2018-10-03 01:51:01 -0400
commit02841052aa5e2126089268f465858fff379577d8 (patch)
treef739454355d27fc8d65d430289f94a0b92c73bd4
parent37ee05f7c0f1fa8d94317e92795016e91f1bdfa6 (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.
-rw-r--r--src/core/file_sys/submission_package.cpp2
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()) {