Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Cosmetics around #include.
[simgrid.git] / src / xbt / xbt_replay.cpp
index 2c51d9d81aa3326b21f97e3ec48186478c553bc1..e77a1f93fd1da9382d3389f6e538d6c12a8c8f51 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010-2019. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2010-2021. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -70,20 +70,19 @@ static ReplayAction* get_action(const char* name)
 
       // if it's for me, I'm done
       std::string evtname = action->front();
-      if (evtname.compare(name) == 0) {
+      if (evtname.compare(name) == 0)
         return action;
-      } else {
-        // Else, I have to store it for the relevant colleague
-        std::queue<ReplayAction*>* otherqueue = nullptr;
-        auto act                              = action_queues.find(evtname);
-        if (act != action_queues.end()) {
-          otherqueue = act->second;
-        } else { // Damn. Create the queue of that guy
-          otherqueue = new std::queue<ReplayAction*>();
-          action_queues.insert({evtname, otherqueue});
-        }
-        otherqueue->push(action);
+
+      // Else, I have to store it for the relevant colleague
+      std::queue<ReplayAction*>* otherqueue = nullptr;
+      auto act                              = action_queues.find(evtname);
+      if (act != action_queues.end()) {
+        otherqueue = act->second;
+      } else { // Damn. Create the queue of that guy
+        otherqueue = new std::queue<ReplayAction*>();
+        action_queues.insert({evtname, otherqueue});
       }
+      otherqueue->push(action);
     }
     // end of file reached while searching in vain for more work
   } else {
@@ -124,8 +123,7 @@ int replay_runner(const char* actor_name, const char* trace_filename)
       delete evt;
     }
     if (action_queues.find(actor_name_string) != action_queues.end()) {
-      std::queue<ReplayAction*>* myqueue = action_queues.at(actor_name_string);
-      delete myqueue;
+      delete action_queues.at(actor_name_string);
       action_queues.erase(actor_name_string);
     }
   } else { // Should have got my trace file in argument