No need for immediate-call lambda

This commit is contained in:
Pcornat 2026-01-22 21:48:49 +01:00
commit 2c53334e8f
Signed by: Pcornat
GPG key ID: E0326CC678A00BDD

View file

@ -79,8 +79,8 @@ namespace gui_to_app {
rock_kit_switch = app_builder->get_widget<Gtk::Switch>("rock_kit_switch");
sack_switch = app_builder->get_widget<Gtk::Switch>("sack_switch");
const auto test_result = [this] -> std::vector<const char *> {
const std::array test_ptrs{
const auto test_result = ranges::to<std::vector<const char *> >(
std::array{
std::pair{ "sword_switch", sword_switch == nullptr },
std::pair{ "lance_switch", lance_switch == nullptr },
std::pair{ "morgen_switch", morgen_switch == nullptr },
@ -93,14 +93,11 @@ namespace gui_to_app {
std::pair{ "dagger_switch", dagger_switch == nullptr },
std::pair{ "rock_kit_switch", rock_kit_switch == nullptr },
std::pair{ "sack_switch", sack_switch == nullptr },
};
}
| views::filter([](const auto &a) { return a.second; })
| views::keys
);
return ranges::to<std::vector<const char *> >(
test_ptrs
| views::filter([](const auto &a) { return a.second; })
| views::keys
);
}();
if (!test_result.empty()) {
spdlog::critical("Error occurred, at least one switch is not available. See logs below");
for (const auto result: test_result) {