From: Martin Quinson Date: Tue, 15 Nov 2011 08:40:58 +0000 (+0100) Subject: further streamline r_get_route_a_l: now that latency is nicely additive, no need... X-Git-Tag: exp_20120216~275 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/5d57065c68eab066b8c951de6c1fcedd2ec15885 further streamline r_get_route_a_l: now that latency is nicely additive, no need for extra precaution --- diff --git a/src/surf/surf_routing.c b/src/surf/surf_routing.c index 7b4427c069..bca8c1cfb6 100644 --- a/src/surf/surf_routing.c +++ b/src/surf/surf_routing.c @@ -561,12 +561,11 @@ static void _get_route_and_latency(const char *src, const char *dst, /* If source gateway is not our source, we have to recursively find our way up to this point */ if (strcmp(src, e_route_cnt->src_gateway)) { - double latency_src; xbt_dynar_t route_src; _get_route_and_latency(src, e_route_cnt->src_gateway, (route ? &route_src : NULL), - (latency ? &latency_src : NULL)); + latency); xbt_assert(route_src, "no route between \"%s\" and \"%s\"", src, e_route_cnt->src_gateway); @@ -574,9 +573,6 @@ static void _get_route_and_latency(const char *src, const char *dst, xbt_dynar_push(*route, &link); } xbt_dynar_free(&route_src); - - if (latency) - *latency += latency_src; } xbt_dynar_foreach(e_route_cnt->link_list, cpt, link) { @@ -585,12 +581,11 @@ static void _get_route_and_latency(const char *src, const char *dst, /* If dest gateway is not our destination, we have to recursively find our way from this point */ if (strcmp(e_route_cnt->dst_gateway, dst)) { - double latency_dst; xbt_dynar_t route_dst; _get_route_and_latency(e_route_cnt->dst_gateway, dst, (route ? &route_dst : NULL), - (latency ? &latency_dst : NULL)); + latency); xbt_assert(route_dst, "no route between \"%s\" and \"%s\"", e_route_cnt->dst_gateway, dst); @@ -599,8 +594,6 @@ static void _get_route_and_latency(const char *src, const char *dst, } xbt_dynar_free(&route_dst); - if (latency) - *latency += latency_dst; } generic_free_route(e_route_cnt);