X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/e709643ef0c5b61c6c878016c418bffa2b1b20cd..08e7455d67920bbd7a87f440d00f2c1e071314a0:/src/kernel/routing/DijkstraZone.cpp diff --git a/src/kernel/routing/DijkstraZone.cpp b/src/kernel/routing/DijkstraZone.cpp index bb780822b1..3c3378dca9 100644 --- a/src/kernel/routing/DijkstraZone.cpp +++ b/src/kernel/routing/DijkstraZone.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2009-2020. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2009-2021. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ @@ -57,7 +57,7 @@ void DijkstraZone::seal() } if (not found) { - RouteCreationArgs* route = new simgrid::kernel::routing::RouteCreationArgs(); + auto* route = new simgrid::kernel::routing::RouteCreationArgs(); route->link_list.push_back(network_model_->loopback_); xbt_graph_new_edge(route_graph_.get(), node, node, route); } @@ -68,7 +68,7 @@ void DijkstraZone::seal() const_xbt_dynar_t nodes = xbt_graph_get_nodes(route_graph_.get()); xbt_dynar_foreach (nodes, cursor, node) { - GraphNodeData* data = static_cast(xbt_graph_node_get_data(node)); + auto* data = static_cast(xbt_graph_node_get_data(node)); data->graph_id_ = cursor; } } @@ -129,8 +129,8 @@ void DijkstraZone::get_local_route(NetPoint* src, NetPoint* dst, RouteCreationAr int nr_nodes = xbt_dynar_length(nodes); std::vector cost_arr(nr_nodes); /* link cost from src to other hosts */ pred_arr.resize(nr_nodes); /* predecessors in path from src */ - typedef std::pair Qelt; - std::priority_queue, std::greater> pqueue; + using Qelt = std::pair; + std::priority_queue, std::greater<>> pqueue; /* initialize */ cost_arr[src_node_id] = 0.0; @@ -227,12 +227,10 @@ void DijkstraZone::add_route(NetPoint* src, NetPoint* dst, NetPoint* gw_src, Net { add_route_check_params(src, dst, gw_src, gw_dst, link_list, symmetrical); - new_edge(src->id(), dst->id(), - new_extended_route(hierarchy_, src, dst, gw_src, gw_dst, link_list, symmetrical, true)); + new_edge(src->id(), dst->id(), new_extended_route(hierarchy_, gw_src, gw_dst, link_list, true)); - if (symmetrical == true) - new_edge(dst->id(), src->id(), - new_extended_route(hierarchy_, dst, src, gw_dst, gw_src, link_list, symmetrical, false)); + if (symmetrical) + new_edge(dst->id(), src->id(), new_extended_route(hierarchy_, gw_dst, gw_src, link_list, false)); } void DijkstraZone::new_edge(int src_id, int dst_id, RouteCreationArgs* route)