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
unPERLifies a bit the routing: use the object, not its name
[simgrid.git]
/
src
/
s4u
/
s4u_host.cpp
diff --git
a/src/s4u/s4u_host.cpp
b/src/s4u/s4u_host.cpp
index
ed367e8
..
523aee6
100644
(file)
--- a/
src/s4u/s4u_host.cpp
+++ b/
src/s4u/s4u_host.cpp
@@
-20,7
+20,7
@@
#include "simgrid/s4u/host.hpp"
#include "simgrid/s4u/storage.hpp"
#include "simgrid/s4u/host.hpp"
#include "simgrid/s4u/storage.hpp"
-std::unordered_map<s
imgrid::xbt
::string, simgrid::s4u::Host*> host_list; // FIXME: move it to Engine
+std::unordered_map<s
td
::string, simgrid::s4u::Host*> host_list; // FIXME: move it to Engine
int MSG_HOST_LEVEL = -1;
int USER_HOST_LEVEL = -1;
int MSG_HOST_LEVEL = -1;
int USER_HOST_LEVEL = -1;
@@
-78,11
+78,13
@@
Host* Host::by_name(std::string name)
}
Host* Host::by_name_or_null(const char* name)
{
}
Host* Host::by_name_or_null(const char* name)
{
- try {
- return host_list.at(name);
- } catch (std::out_of_range& e) {
+ return by_name_or_null(std::string(name));
+}
+Host* Host::by_name_or_null(std::string name)
+{
+ if (host_list.find(name) == host_list.end())
return nullptr;
return nullptr;
- }
+ return host_list.at(name);
}
Host *Host::current(){
}
Host *Host::current(){