void ExecImpl::post()
{
xbt_assert(surf_action_ != nullptr);
- auto const& hosts = get_hosts();
- if (std::any_of(hosts.begin(), hosts.end(), [](const s4u::Host* host) { return not host->is_on(); })) {
+ if (auto const& hosts = get_hosts();
+ std::any_of(hosts.begin(), hosts.end(), [](const s4u::Host* host) { return not host->is_on(); })) {
/* If one of the hosts running the synchro failed, notice it. This way, the asking
* process can be killed if it runs on that host itself */
set_state(State::FAILED);