Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
cosmetics
authorMartin Quinson <martin.quinson@loria.fr>
Thu, 22 Sep 2016 08:35:50 +0000 (10:35 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Thu, 22 Sep 2016 19:23:43 +0000 (21:23 +0200)
src/surf/network_cm02.cpp
src/surf/network_interface.cpp

index a2f7152..ad17bf6 100644 (file)
@@ -176,10 +176,9 @@ Link* NetworkCm02Model::createLink(const char *name, double bandwidth, double la
 
 void NetworkCm02Model::updateActionsStateLazy(double now, double /*delta*/)
 {
-  NetworkCm02Action *action;
   while ((xbt_heap_size(actionHeap_) > 0)
          && (double_equals(xbt_heap_maxkey(actionHeap_), now, sg_surf_precision))) {
-    action = static_cast<NetworkCm02Action*> (xbt_heap_pop(actionHeap_));
+    NetworkCm02Action *action = static_cast<NetworkCm02Action*> (xbt_heap_pop(actionHeap_));
     XBT_DEBUG("Something happened to action %p", action);
     if (TRACE_is_enabled()) {
       int n = lmm_get_number_of_cnst_from_var(maxminSystem_, action->getVariable());
index 00ea637..86ebe14 100644 (file)
@@ -131,18 +131,14 @@ namespace simgrid {
 
     double NetworkModel::next_occuring_event_full(double now)
     {
-      NetworkAction *action = nullptr;
       ActionList *runningActions = surf_network_model->getRunningActionSet();
-      double minRes;
-
-      minRes = shareResourcesMaxMin(runningActions, surf_network_model->maxminSystem_, surf_network_model->f_networkSolve);
+      double minRes = shareResourcesMaxMin(runningActions, surf_network_model->maxminSystem_, surf_network_model->f_networkSolve);
 
       for(ActionList::iterator it(runningActions->begin()), itend(runningActions->end())
           ; it != itend ; ++it) {
-        action = static_cast<NetworkAction*>(&*it);
-        if (action->latency_ > 0) {
+        NetworkAction *action = static_cast<NetworkAction*>(&*it);
+        if (action->latency_ > 0)
           minRes = (minRes < 0) ? action->latency_ : std::min(minRes, action->latency_);
-        }
       }
 
       XBT_DEBUG("Min of share resources %f", minRes);