Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Kill redundent sanity checks
[simgrid.git] / src / mc / mc_record.cpp
index 8330582fe582663e25e9d07b3e59f7881a784a19..72483fe420851734cc0fb7ab91963002cbd6f400 100644 (file)
@@ -18,8 +18,7 @@
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_record, mc, "Logging specific to MC record/replay facility");
 
-namespace simgrid {
-namespace mc {
+namespace simgrid::mc {
 
 void RecordTrace::replay() const
 {
@@ -61,9 +60,8 @@ simgrid::mc::RecordTrace::RecordTrace(const char* data)
   while (*current) {
     long aid;
     int times_considered;
-    int count = sscanf(current, "%ld/%d", &aid, &times_considered);
 
-    if(count != 2 && count != 1)
+    if (int count = sscanf(current, "%ld/%d", &aid, &times_considered); count != 2 && count != 1)
       throw std::invalid_argument("Could not parse record path");
     push_back(new simgrid::mc::Transition(simgrid::mc::Transition::Type::UNKNOWN, aid, times_considered));
 
@@ -93,5 +91,4 @@ std::string simgrid::mc::RecordTrace::to_string() const
 
 #endif
 
-}
-}
+} // namespace simgrid::mc