Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Prefer using "try_emplace" (sonar, c++17).
[simgrid.git] / src / surf / network_ib.cpp
index b50b769..c6362f6 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2014-2021. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2014-2022. 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. */
@@ -53,7 +53,7 @@ void NetworkIBModel::IB_create_host_callback(s4u::Host const& host)
 {
   static int id = 0;
   auto* ibModel = static_cast<NetworkIBModel*>(host.get_netpoint()->get_englobing_zone()->get_network_model().get());
-  ibModel->active_nodes.emplace(host.get_name(), IBNode(id));
+  ibModel->active_nodes.try_emplace(host.get_name(), IBNode(id));
   id++;
 }