Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Use 'auto' with functions returning iterators [sonar].
[simgrid.git] / src / kernel / activity / CommImpl.cpp
index 9b57df5..fc67a92 100644 (file)
@@ -579,8 +579,8 @@ void CommImpl::finish()
         simcall->timeout_cb_ = nullptr;
       }
       if (not MC_is_active() && not MC_record_replay_is_active()) {
-        CommImpl** element = std::find(comms, comms + count, this);
-        ssize_t rank       = (element != comms + count) ? element - comms : -1;
+        auto element = std::find(comms, comms + count, this);
+        ssize_t rank = (element != comms + count) ? element - comms : -1;
         simcall_comm_waitany__set__result(simcall, rank);
       }
     }
@@ -672,8 +672,8 @@ void CommImpl::finish()
         comms = simcall_comm_testany__get__comms(simcall);
         count = simcall_comm_testany__get__count(simcall);
       }
-      CommImpl** element = std::find(comms, comms + count, this);
-      ssize_t rank       = (element != comms + count) ? element - comms : -1;
+      auto element = std::find(comms, comms + count, this);
+      ssize_t rank = (element != comms + count) ? element - comms : -1;
       // In order to modify the exception we have to rethrow it:
       try {
         std::rethrow_exception(simcall->issuer_->exception_);