A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Prefer using "try_emplace" (sonar, c++17).
[simgrid.git]
/
src
/
s4u
/
s4u_Engine.cpp
diff --git
a/src/s4u/s4u_Engine.cpp
b/src/s4u/s4u_Engine.cpp
index
858ee1f
..
76166e0
100644
(file)
--- a/
src/s4u/s4u_Engine.cpp
+++ b/
src/s4u/s4u_Engine.cpp
@@
-268,7
+268,7
@@
Mailbox* Engine::mailbox_by_name_or_create(const std::string& name) const
{
/* two actors may have pushed the same mbox_create simcall at the same time */
kernel::activity::MailboxImpl* mbox = kernel::actor::simcall_answered([&name, this] {
- auto m = pimpl->mailboxes_.emplace(name, nullptr);
+ auto m = pimpl->mailboxes_.
try_
emplace(name, nullptr);
if (m.second) {
m.first->second = new kernel::activity::MailboxImpl(name);
XBT_DEBUG("Creating a mailbox at %p with name %s", m.first->second, name.c_str());