aboutsummaryrefslogtreecommitdiff
path: root/src/core/file_sys
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
commitb77f6a32ff1957f88bcb521323aef62efb13d87a (patch)
treef739454355d27fc8d65d430289f94a0b92c73bd4 /src/core/file_sys
parent8f51371d7b9d29bb5599016b5a7ee9fb43756e78 (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/core/file_sys')
-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 d39b79eddf..c3848e826f 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()) {