Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of https://framagit.org/simgrid/simgrid
[simgrid.git] / src / mc / api / strategy / MaxMatchComm.hpp
index 7ec0af9..77dadd1 100644 (file)
@@ -25,7 +25,7 @@ class MaxMatchComm : public Strategy {
 public:
   void copy_from(const Strategy* strategy) override
   {
-    const MaxMatchComm* cast_strategy = dynamic_cast<MaxMatchComm const*>(strategy);
+    const auto* cast_strategy = dynamic_cast<MaxMatchComm const*>(strategy);
     xbt_assert(cast_strategy != nullptr);
     for (auto& [id, val] : cast_strategy->mailbox_)
       mailbox_[id] = val;
@@ -51,19 +51,19 @@ public:
       const Transition* transition = actor.get_transition(actor.get_times_considered()).get();
 
       if (auto const* cast_recv = dynamic_cast<CommRecvTransition const*>(transition)) {
-        if (mailbox_.count(cast_recv->get_mailbox()) > 0 && mailbox_.at(cast_recv->get_mailbox()) > 0) {
-          aid_value--; // This means we have waiting recv corresponding to this recv
-        } else {
-          aid_value++;
-        }
+            if (mailbox_.count(cast_recv->get_mailbox()) > 0 && mailbox_.at(cast_recv->get_mailbox()) > 0) {
+              aid_value--; // This means we have waiting recv corresponding to this recv
+            } else {
+              aid_value++;
+            }
       }
 
       if (auto const* cast_send = dynamic_cast<CommSendTransition const*>(transition)) {
-        if (mailbox_.count(cast_send->get_mailbox()) > 0 && mailbox_.at(cast_send->get_mailbox()) < 0) {
-          aid_value--; // This means we have waiting recv corresponding to this send
-        } else {
-          aid_value++;
-        }
+            if (mailbox_.count(cast_send->get_mailbox()) > 0 && mailbox_.at(cast_send->get_mailbox()) < 0) {
+              aid_value--; // This means we have waiting recv corresponding to this send
+            } else {
+              aid_value++;
+            }
       }
 
       if (aid_value < min_found.second)