2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-10 01:47:43 +00:00

Runtime: Remove unnecessary c_str() calls

Makes for less noisy code and also gets rid of unnecessary std::strlen
calls in the case things are passed to a std::string_view parameter.
This commit is contained in:
Lioncash
2020-02-28 05:11:20 -05:00
parent 08604d770a
commit f1256faeb7
6 changed files with 26 additions and 25 deletions

View File

@@ -337,8 +337,9 @@ void CMain::AddWorldPaks() {
if (i != 0)
path += '0' + i;
if (CDvdFile::FileExists((path + ".upak").c_str()))
if (CDvdFile::FileExists(path + ".upak")) {
loader->AddPakFileAsync(path, false, true);
}
}
loader->WaitForPakFileLoadingComplete();
}
@@ -352,9 +353,10 @@ void CMain::AddOverridePaks() {
* the higher the number the higer the priority, e.g: Override0 has less priority than Override1 etc.
*/
for (size_t i = 999; i > 0; --i) {
std::string path = fmt::format(fmt("Override{}"), i);
if (CDvdFile::FileExists((path + ".upak").c_str()))
const std::string path = fmt::format(fmt("Override{}"), i);
if (CDvdFile::FileExists(path + ".upak")) {
loader->AddPakFileAsync(path, false, false, true);
}
}
/* Make sure all Override paks are ready before attempting to load URDE.upak */
loader->WaitForPakFileLoadingComplete();