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

Public GIT Repository
Inline a function of mc::api
[simgrid.git] / src / mc / mc_record.cpp
index bc2b30c4a890452380a70e544160c6b858a24f05..02522b06cc2b49194c84962f371947e7e690e9f3 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2014-2021. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2014-2022. 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. */
@@ -58,8 +58,10 @@ RecordTrace parseRecordTrace(const char* data)
 
   const char* current = data;
   while (*current) {
-    simgrid::mc::Transition item;
-    int count = sscanf(current, "%ld/%d", &item.aid_, &item.times_considered_);
+    long aid;
+    int times_considered;
+    int count = sscanf(current, "%ld/%d", &aid, &times_considered);
+    simgrid::mc::Transition item(aid, times_considered);
 
     if(count != 2 && count != 1)
       throw std::invalid_argument("Could not parse record path");
@@ -85,7 +87,7 @@ std::string traceToString(simgrid::mc::RecordTrace const& trace)
     if (i != trace.begin())
       stream << ';';
     stream << i->aid_;
-    if (i->times_considered_)
+    if (i->times_considered_ > 0)
       stream << '/' << i->times_considered_;
   }
   return stream.str();