Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Prefer using "try_emplace" (sonar, c++17).
[simgrid.git] / src / instr / instr_paje_types.cpp
index 41f66c9..0e31281 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012-2021. The SimGrid Team.
+/* Copyright (c) 2012-2022. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -137,7 +137,7 @@ void ValueType::add_entity_value(const std::string& name, const std::string& col
   auto it = values_.find(name);
   if (it == values_.end()) {
     XBT_DEBUG("new value %s, child of %s", name.c_str(), get_cname());
-    values_.emplace(name, EntityValue(name, color, this));
+    values_.try_emplace(name, EntityValue(name, color, this));
   }
 }