/* Build a copy that will be stored in the dict */
auto* newRoute = new BypassRoute(gw_src, gw_dst);
- for (auto const& link : link_list_)
- newRoute->links.push_back(link);
+ newRoute->links.insert(newRoute->links.end(), begin(link_list_), end(link_list_));
/* Store it */
bypass_routes_.insert({{src, dst}, newRoute});
if (dst->get_englobing_zone() == this && src->get_englobing_zone() == this) {
if (bypass_routes_.find({src, dst}) != bypass_routes_.end()) {
const BypassRoute* bypassedRoute = bypass_routes_.at({src, dst});
- for (resource::LinkImpl* const& link : bypassedRoute->links) {
- links.push_back(link);
- if (latency)
- *latency += link->get_latency();
- }
+ add_link_latency(links, bypassedRoute->links, latency);
XBT_DEBUG("Found a bypass route from '%s' to '%s' with %zu links", src->get_cname(), dst->get_cname(),
bypassedRoute->links.size());
return true;
src->get_cname(), dst->get_cname(), bypassedRoute->links.size());
if (src != key.first)
get_global_route_with_netzones(src, bypassedRoute->gw_src, links, latency, netzones);
- for (resource::LinkImpl* const& link : bypassedRoute->links) {
- links.push_back(link);
- if (latency)
- *latency += link->get_latency();
- }
+ add_link_latency(links, bypassedRoute->links, latency);
if (dst != key.second)
get_global_route_with_netzones(bypassedRoute->gw_dst, dst, links, latency, netzones);
return true;