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
Use const references (sonar).
[simgrid.git]
/
src
/
instr
/
instr_paje_containers.cpp
diff --git
a/src/instr/instr_paje_containers.cpp
b/src/instr/instr_paje_containers.cpp
index
8442abd
..
647857d
100644
(file)
--- a/
src/instr/instr_paje_containers.cpp
+++ b/
src/instr/instr_paje_containers.cpp
@@
-1,4
+1,4
@@
-/* Copyright (c) 2010-202
1
. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2010-202
2
. 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. */
/* 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. */
@@
-23,7
+23,7
@@
NetZoneContainer::NetZoneContainer(const std::string& name, unsigned int level,
if (parent_) {
std::string type_name = std::string("L") + std::to_string(level);
type_ = parent_->type_->by_name_or_create<ContainerType>(type_name);
if (parent_) {
std::string type_name = std::string("L") + std::to_string(level);
type_ = parent_->type_->by_name_or_create<ContainerType>(type_name);
- parent_->children_.
insert({get_name(), this}
);
+ parent_->children_.
try_emplace(get_name(), this
);
on_creation(*this);
} else {
type_ = new ContainerType("0");
on_creation(*this);
} else {
type_ = new ContainerType("0");
@@
-57,13
+57,13
@@
Container::Container(const std::string& name, const std::string& type_name, Cont
if (not type_name.empty()) {
type_ = parent_->type_->by_name_or_create<ContainerType>(type_name);
if (not type_name.empty()) {
type_ = parent_->type_->by_name_or_create<ContainerType>(type_name);
- parent_->children_.
insert({name_, this}
);
+ parent_->children_.
try_emplace(name_, this
);
on_creation(*this);
}
}
//register all kinds by name
on_creation(*this);
}
}
//register all kinds by name
- if (not all_containers_.emplace(name_, this).second)
+ if (not all_containers_.
try_
emplace(name_, this).second)
throw TracingError(XBT_THROW_POINT,
xbt::string_printf("container %s already present in all_containers_", get_cname()));
throw TracingError(XBT_THROW_POINT,
xbt::string_printf("container %s already present in all_containers_", get_cname()));
@@
-74,8
+74,8
@@
Container::~Container()
{
XBT_DEBUG("destroy container %s", get_cname());
// Begin with destroying my own children
{
XBT_DEBUG("destroy container %s", get_cname());
// Begin with destroying my own children
- for (auto c
hild
: children_)
- delete child
.second
;
+ for (auto c
onst& [_, child]
: children_)
+ delete child;
// remove me from the all_containers_ data structure
all_containers_.erase(name_);
// remove me from the all_containers_ data structure
all_containers_.erase(name_);