X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/8164c2d758134b0e83cded911ddd43ce07dc8ead..d6ee04bb4b77788c1f17220a2117f41573c9dcde:/src/kernel/routing/FullZone.cpp?ds=sidebyside diff --git a/src/kernel/routing/FullZone.cpp b/src/kernel/routing/FullZone.cpp index d6e4660ec5..a05458a3f0 100644 --- a/src/kernel/routing/FullZone.cpp +++ b/src/kernel/routing/FullZone.cpp @@ -34,8 +34,7 @@ void FullZone::seal() e_route = new s_sg_platf_route_cbarg_t; e_route->gw_src = nullptr; e_route->gw_dst = nullptr; - e_route->link_list = new std::vector(); - e_route->link_list->push_back(surf_network_model->loopback_); + e_route->link_list.push_back(surf_network_model->loopback_); TO_ROUTE_FULL(i, i) = e_route; } } @@ -48,12 +47,8 @@ FullZone::~FullZone() unsigned int table_size = getTableSize(); /* Delete routing table */ for (unsigned int i = 0; i < table_size; i++) - for (unsigned int j = 0; j < table_size; j++) { - if (TO_ROUTE_FULL(i, j)) { - delete TO_ROUTE_FULL(i, j)->link_list; - delete TO_ROUTE_FULL(i, j); - } - } + for (unsigned int j = 0; j < table_size; j++) + delete TO_ROUTE_FULL(i, j); delete[] routingTable_; } } @@ -68,8 +63,8 @@ void FullZone::getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cbarg_ if (e_route != nullptr) { res->gw_src = e_route->gw_src; res->gw_dst = e_route->gw_dst; - for (auto const& link : *e_route->link_list) { - res->link_list->push_back(link); + for (auto const& link : e_route->link_list) { + res->link_list.push_back(link); if (lat) *lat += link->latency(); }