From: Arnaud Giersch Date: Wed, 30 Oct 2019 16:36:36 +0000 (+0100) Subject: Useless if(). X-Git-Tag: v3.25~473 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/b00129b778bffa861c093a6b065d6989c608d152?hp=0564c942642d204173fe46bbc110489adfe3579d;ds=sidebyside Useless if(). --- diff --git a/src/surf/HostImpl.cpp b/src/surf/HostImpl.cpp index 1b96df7f04..d9a6e3ef94 100644 --- a/src/surf/HostImpl.cpp +++ b/src/surf/HostImpl.cpp @@ -121,12 +121,10 @@ void HostImpl::turn_on() /** Kill all actors hosted here */ void HostImpl::turn_off() { - if (not actor_list_.empty()) { - for (auto& actor : actor_list_) { - XBT_DEBUG("Killing Actor %s@%s on behalf of %s which turned off that host.", actor.get_cname(), - actor.get_host()->get_cname(), SIMIX_process_self()->get_cname()); - SIMIX_process_self()->kill(&actor); - } + for (auto& actor : actor_list_) { + XBT_DEBUG("Killing Actor %s@%s on behalf of %s which turned off that host.", actor.get_cname(), + actor.get_host()->get_cname(), SIMIX_process_self()->get_cname()); + SIMIX_process_self()->kill(&actor); } // When a host is turned off, we want to keep only the actors that should restart for when it will boot again. // Then get rid of the others.