Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of framagit.org:simgrid/simgrid
[simgrid.git] / src / mc / explo / odpor / Execution.cpp
index ef10e4f..3f10062 100644 (file)
@@ -87,7 +87,7 @@ std::unordered_set<Execution::EventHandle> Execution::get_racing_events_of(Execu
       // 2. disqualified_events.count(e_j) > 0
       // then e_i --->_E target indirectly (either through
       // e_j directly, or transitively through e_j)
-      if (disqualified_events.count(e_j) > 0 and happens_before(e_i, e_j)) {
+      if (disqualified_events.count(e_j) > 0 && happens_before(e_i, e_j)) {
         disqualified_events.insert(e_i);
         break;
       }
@@ -164,7 +164,7 @@ Execution::get_missing_source_set_actors_from(EventHandle e, const std::unordere
     // happen after `e` is a member of `v`. In addition to marking
     // the event in `v`, we also "simulate" running the action `v`
     // from E'
-    if (not happens_before(e, e_prime) or e_prime == next_E_p) {
+    if (not happens_before(e, e_prime) || e_prime == next_E_p) {
       // First, push the transition onto the hypothetical execution
       E_prime_v.push_transition(get_event_with_handle(e_prime).get_transition());
       const EventHandle e_prime_in_E_prime_v = E_prime_v.get_latest_event_handle().value();
@@ -206,7 +206,7 @@ Execution::get_missing_source_set_actors_from(EventHandle e, const std::unordere
       }
     }
   }
-  xbt_assert(!I_E_prime_v.empty(),
+  xbt_assert(not I_E_prime_v.empty(),
              "For any non-empty execution, we know that "
              "at minimum one actor is an initial since "
              "some execution is possible with respect to a "
@@ -412,10 +412,8 @@ std::optional<PartialExecution> Execution::get_shortest_odpor_sq_subset_insertio
   auto w_now = w;
 
   for (const auto& next_E_p : v) {
-    const aid_t p = next_E_p->aid_;
-
     // Is `p in `I_[E](w)`?
-    if (E_v.is_initial_after_execution_of(w_now, p)) {
+    if (const aid_t p = next_E_p->aid_; E_v.is_initial_after_execution_of(w_now, p)) {
       // Remove `p` from w and continue
 
       // INVARIANT: If `p` occurs in `w`, it had better refer to the same
@@ -487,4 +485,4 @@ bool Execution::happens_before(Execution::EventHandle e1_handle, Execution::Even
   return false;
 }
 
-} // namespace simgrid::mc::odpor
\ No newline at end of file
+} // namespace simgrid::mc::odpor