X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/db9ef2223acb402e44eec406541e671bfebd5ade..371d168e21b83e2364c2ac2dbff3847588769c2b:/src/kernel/routing/DijkstraZone.cpp diff --git a/src/kernel/routing/DijkstraZone.cpp b/src/kernel/routing/DijkstraZone.cpp index 150bf22685..216961020d 100644 --- a/src/kernel/routing/DijkstraZone.cpp +++ b/src/kernel/routing/DijkstraZone.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2009-2022. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2009-2023. 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. */ @@ -13,11 +13,10 @@ #include #include -XBT_LOG_NEW_DEFAULT_SUBCATEGORY(ker_routing_dijkstra, ker_routing, "Kernel Dijkstra Routing"); +XBT_LOG_NEW_DEFAULT_SUBCATEGORY(ker_routing_dijkstra, ker_platform, "Kernel Dijkstra Routing"); namespace simgrid { -namespace kernel { -namespace routing { +namespace kernel::routing { class GraphNodeData { public: @@ -113,10 +112,10 @@ void DijkstraZone::get_local_route(const NetPoint* src, const NetPoint* dst, Rou insert_link_latency(route->link_list_, e_route->link_list_, lat); } - auto elm = route_cache_.try_emplace(src_id, std::vector()); - std::vector& pred_arr = elm.first->second; + auto [elm, inserted] = route_cache_.try_emplace(src_id); + std::vector& pred_arr = elm->second; - if (elm.second) { /* new element was inserted (not cached mode, or cache miss) */ + if (inserted) { /* new element was inserted (not cached mode, or cache miss) */ unsigned long 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 */ @@ -245,8 +244,7 @@ void DijkstraZone::new_edge(unsigned long src_id, unsigned long dst_id, Route* r // Finally add it xbt_graph_new_edge(route_graph_.get(), src, dst, route); } -} // namespace routing -} // namespace kernel +} // namespace kernel::routing namespace s4u { NetZone* create_dijkstra_zone(const std::string& name, bool cache)