]> AND Public Git Repository - simgrid.git/blobdiff - src/kernel/routing/DijkstraZone.cpp
Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Finally kill mc::RemoteProcess::actors(). We now communicate the data over the wire...
[simgrid.git] / src / kernel / routing / DijkstraZone.cpp
index 150bf2268587ab6b887aea6edf122d21a604f048..03fdcbf78b261390ce753562d62726dffee548bd 100644 (file)
@@ -16,8 +16,7 @@
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(ker_routing_dijkstra, ker_routing, "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<unsigned long>());
-  std::vector<unsigned long>& pred_arr = elm.first->second;
+  auto [elm, inserted]                 = route_cache_.try_emplace(src_id);
+  std::vector<unsigned long>& 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<unsigned long> 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)