diff options
| author | Stanislaw Halik <sthalik@misaki.pl> | 2022-11-12 19:44:09 +0100 |
|---|---|---|
| committer | Stanislaw Halik <sthalik@misaki.pl> | 2022-11-12 19:44:25 +0100 |
| commit | 6ca808b5f4a60b1f65b816ff8b9401fd7b2ec1bd (patch) | |
| tree | 11716eee1147ec3e50e76d22052052f333adac2c | |
| parent | b6cbd10e8a64974c1eb5eb4f940121711da889e8 (diff) | |
don't branch in loader::ensure_plugins
| -rw-r--r-- | loader/impl.cpp | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/loader/impl.cpp b/loader/impl.cpp index 6b0ba333..65516e17 100644 --- a/loader/impl.cpp +++ b/loader/impl.cpp @@ -31,18 +31,15 @@ loader_impl::~loader_impl() = default; void loader_impl::ensure_plugins() { - if (!importer_plugins) - importer_plugins.emplace(); - if (!image_importer) - { - image_importer = importer_plugins->loadAndInstantiate("StbImageImporter"); - fm_assert(image_importer); - } - if (!tga_importer) - { - tga_importer = importer_plugins->loadAndInstantiate("TgaImporter"); - fm_assert(tga_importer); - } + if (importer_plugins) + return; + + importer_plugins.emplace(); + image_importer = importer_plugins->loadAndInstantiate("StbImageImporter"); + tga_importer = importer_plugins->loadAndInstantiate("TgaImporter"); + + fm_assert(image_importer); + fm_assert(tga_importer); } } // namespace floormat::loader_detail |
