From 49e057ae96bffa57554a65241051350af1b105b7 Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Fri, 27 Apr 2012 12:03:58 +0200 Subject: [PATCH] Pass 'res->link_list' and 'lat' directly to routing_get_route_and_latency(). --- src/surf/surf_routing_floyd.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/surf/surf_routing_floyd.c b/src/surf/surf_routing_floyd.c index 57596ca94a..bcb048e5b5 100644 --- a/src/surf/surf_routing_floyd.c +++ b/src/surf/surf_routing_floyd.c @@ -100,17 +100,8 @@ static void floyd_get_route_and_latency(AS_t asg, sg_routing_edge_t src, sg_rout if (asg->hierarchy == SURF_ROUTING_RECURSIVE && prev_dst_gw != NULL && strcmp(prev_dst_gw->name, e_route->src_gateway->name)) { - links = xbt_dynar_new(sizeof(sg_routing_link_t), NULL); - /* Would it be right to pass 'res->link_list' and 'lat' to - * routing_get_route_and_latency() here, and avoid the following loop? */ routing_get_route_and_latency(prev_dst_gw, e_route->src_gateway, - &links, NULL); - xbt_dynar_foreach(links, cpt, link) { - xbt_dynar_push_as(res->link_list, sg_routing_link_t, link); - if (lat) - *lat += surf_network_model->extension.network.get_link_latency(link); - } - xbt_dynar_free(&links); + &res->link_list, lat); } links = e_route->link_list; -- 2.20.1