Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
No need to check for activities_ nullness
authorFabien Chaix <chaix@ics.forth.gr>
Thu, 19 May 2022 07:16:10 +0000 (10:16 +0300)
committerFabien Chaix <chaix@ics.forth.gr>
Thu, 19 May 2022 07:16:10 +0000 (10:16 +0300)
src/surf/HostImpl.cpp

index 4f39fab..5ba84b9 100644 (file)
@@ -95,12 +95,10 @@ void HostImpl::turn_off(const actor::ActorImpl* issuer)
     issuer->kill(&actor);
   }
   for (const auto& activity : EngineImpl::get_instance()->get_maestro()->activities_) {
-    if (activity != nullptr) {
-      auto hosts = activity->get_hosts();
-      if (std::find(hosts.begin(), hosts.end(), &piface_) != hosts.end()) {
-        activity->cancel();
-        activity->set_state(activity::State::FAILED);
-      }
+    auto hosts = activity->get_hosts();
+    if (std::find(hosts.begin(), hosts.end(), &piface_) != hosts.end()) {
+      activity->cancel();
+      activity->set_state(activity::State::FAILED);
     }
   }
   // When a host is turned off, we want to keep only the actors that should restart for when it will boot again.