No need for immediate-call lambda
This commit is contained in:
parent
a67eb0d0b5
commit
2c53334e8f
1 changed files with 6 additions and 9 deletions
|
|
@ -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 },
|
||||
};
|
||||
|
||||
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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue