This commit is contained in:
Pcornat 2024-12-18 22:55:42 +01:00
parent abf68d7ad3
commit 124f15c213
Signed by: Pcornat
GPG Key ID: E0326CC678A00BDD

View File

@ -88,14 +88,16 @@ namespace gui_to_app {
std::pair{ "rock_kit_switch", rock_kit_switch == nullptr }, std::pair{ "rock_kit_switch", rock_kit_switch == nullptr },
std::pair{ "sack_switch", sack_switch == nullptr }, std::pair{ "sack_switch", sack_switch == nullptr },
}; };
std::vector<const char *> test_result; std::vector<const char *> local_test_result;
test_result.reserve(test_ptrs.size()); local_test_result.reserve(test_ptrs.size());
std::for_each(test_ptrs.cbegin(), test_ptrs.cend(), [&test_result](const auto &a) { std::for_each(test_ptrs.cbegin(),
test_ptrs.cend(),
[&local_test_result](const auto &a) {
if (a.second) { if (a.second) {
test_result.emplace_back(a.first); local_test_result.emplace_back(a.first);
} }
}); });
return test_result; return local_test_result;
}(); }();
if (!test_result.empty()) { if (!test_result.empty()) {
spdlog::critical("Error occurred, at least one switch is not available. See logs below"); spdlog::critical("Error occurred, at least one switch is not available. See logs below");
@ -115,5 +117,4 @@ namespace gui_to_app {
} }
quit(); quit();
} }
} // gui_to_app } // gui_to_app