diff options
| author | KiritoDv <kiritodev01@gmail.com> | 2024-03-15 09:16:22 -0600 |
|---|---|---|
| committer | KiritoDv <kiritodev01@gmail.com> | 2024-03-15 09:16:22 -0600 |
| commit | 02f2c2f03c5fb386258e62c377a0fcd686b57690 (patch) | |
| tree | 1cdb05ef1e3cf77586d62f1ac24c091db73e95b8 | |
| parent | a6face7240aaa2a95656143069c6c1de96a1ea98 (diff) | |
Fixed performance on modding factories
| -rw-r--r-- | src/Companion.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/Companion.cpp b/src/Companion.cpp index bb55a2f..9bbef7e 100644 --- a/src/Companion.cpp +++ b/src/Companion.cpp @@ -134,7 +134,6 @@ void Companion::ParseEnums(std::string& header) { enumIndex++; this->gEnums[enumName][enumIndex] = line; } - } } @@ -159,8 +158,15 @@ void Companion::ExtractNode(YAML::Node& node, std::string& name, SWrapper* binar return; } + auto impl = factory->get(); + auto exporter = impl->GetExporter(this->gConfig.exporterType); + if(!exporter.has_value()){ + SPDLOG_WARN("No exporter found for {}", name); + return; + } + std::optional<std::shared_ptr<IParsedData>> result; if(this->gConfig.modding) { if(impl->SupportModdedAssets() && this->gModdedAssetPaths.contains(name)) { @@ -187,12 +193,6 @@ void Companion::ExtractNode(YAML::Node& node, std::string& name, SWrapper* binar return; } - auto exporter = factory->get()->GetExporter(this->gConfig.exporterType); - if(!exporter.has_value()){ - SPDLOG_WARN("No exporter found for {}", name); - return; - } - for (auto [fst, snd] : this->gAssetDependencies[this->gCurrentFile]) { if(snd.second) { continue; |
