]> AND Public Git Repository - simgrid.git/blobdiff - src/kernel/activity/ExecImpl.cpp
Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Remove explicit conversion to std::string when it's not required.
[simgrid.git] / src / kernel / activity / ExecImpl.cpp
index 503e2c5d8436dd07a0b982d406f677739f689a3b..32bbd8a1d36f771fa86c84554778a2c98586ddc4 100644 (file)
@@ -145,8 +145,8 @@ ExecImpl& ExecImpl::update_sharing_penalty(double sharing_penalty)
 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);