From: Martin Quinson Date: Wed, 26 Jul 2017 20:21:18 +0000 (+0200) Subject: Using operator[] instead of std::unordered_map::insert X-Git-Tag: v3_17~317 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/3228c673cab99b919374f40f9000e93e970fa994 Using operator[] instead of std::unordered_map::insert insert does not allow to replace the content associted to an already existing key. Initial report and patch by @rktesser as part of #125 (but unrelated to the rest of #125, thus the partial application). Thanks. --- diff --git a/src/xbt/xbt_replay.cpp b/src/xbt/xbt_replay.cpp index 74bc5a3f71..9571091105 100644 --- a/src/xbt/xbt_replay.cpp +++ b/src/xbt/xbt_replay.cpp @@ -177,7 +177,7 @@ int replay_runner(int argc, char* argv[]) */ void xbt_replay_action_register(const char* action_name, action_fun function) { - simgrid::xbt::action_funs.insert({std::string(action_name), function}); + simgrid::xbt::action_funs[std::string(action_name)] = function; } /**