Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix scan-build warning (link may be null).
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Tue, 10 Apr 2018 09:56:32 +0000 (11:56 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Wed, 11 Apr 2018 20:39:10 +0000 (22:39 +0200)
src/s4u/s4u_actor.cpp

index 748091d..9afb794 100644 (file)
@@ -84,7 +84,8 @@ void Actor::migrate(Host* new_host)
 {
   std::string key;
   simgrid::instr::LinkType* link = nullptr;
-  if (TRACE_actor_is_enabled()) {
+  bool tracing                   = TRACE_actor_is_enabled();
+  if (tracing) {
     static long long int counter = 0;
 
     key = std::to_string(counter);
@@ -111,7 +112,7 @@ void Actor::migrate(Host* new_host)
     SIMIX_process_change_host(this->pimpl_, new_host);
   });
 
-  if (TRACE_actor_is_enabled()) {
+  if (tracing) {
     // create new container on the new_host location
     simgrid::instr::Container::byName(new_host->get_name())->createChild(instr_pid(this), "ACTOR");
     // end link