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
Merge branch 'master' of scm.gforge.inria.fr:/gitroot/simgrid/simgrid
[simgrid.git]
/
src
/
s4u
/
s4u_host.cpp
diff --git
a/src/s4u/s4u_host.cpp
b/src/s4u/s4u_host.cpp
index
a1520f9
..
f39b2a2
100644
(file)
--- a/
src/s4u/s4u_host.cpp
+++ b/
src/s4u/s4u_host.cpp
@@
-87,9
+87,11
@@
Host* Host::by_name_or_null(const char* name)
}
Host* Host::by_name_or_null(std::string name)
{
- if (host_list.find(name) == host_list.end())
+ try {
+ return host_list.at(name);
+ } catch (std::out_of_range& unfound) {
return nullptr;
- return host_list.at(name);
+ }
}
Host *Host::current(){