Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Don't build useless temporary object (sonar, c++17).
[simgrid.git] / src / smpi / internals / smpi_deployment.cpp
index 929a7be..921f3c0 100644 (file)
@@ -56,9 +56,7 @@ void SMPI_app_instance_register(const char *name, xbt_main_func_t code, int num_
   if (code != nullptr) // When started with smpirun, we will not execute a function
     simgrid::s4u::Engine::get_instance()->register_function(name, code);
 
-  Instance instance(num_processes);
-
-  smpi_instances.insert(std::pair<std::string, Instance>(name, instance));
+  smpi_instances.try_emplace(name, num_processes);
 }
 
 void smpi_deployment_register_process(const std::string& instance_id, int rank, const simgrid::s4u::Actor* actor)