Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
std::unordered_map are sufficient, no need for boost here
[simgrid.git] / src / surf / network_interface.cpp
index fd3b806..6a0a74a 100644 (file)
@@ -42,13 +42,13 @@ extern "C" {
   void sg_link_data_set(Link *link,void *data) {
     link->setData(data);
   }
-  int sg_link_count(void) {
+  int sg_link_count() {
     return Link::linksCount();
   }
-  Link** sg_link_list(void) {
+  Link** sg_link_list() {
     return Link::linksList();
   }
-  void sg_link_exit(void) {
+  void sg_link_exit() {
     Link::linksExit();
   }
 
@@ -61,7 +61,7 @@ extern "C" {
 namespace simgrid {
   namespace surf {
 
-    boost::unordered_map<std::string,Link *> *Link::links = new boost::unordered_map<std::string,Link *>();
+    std::unordered_map<std::string,Link *> *Link::links = new std::unordered_map<std::string,Link *>();
     Link *Link::byName(const char* name) {
       if (links->find(name) == links->end())
         return nullptr;
@@ -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);