Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
fix NS3 builds
[simgrid.git] / src / surf / network_interface.cpp
index 81c55be..fdb99fc 100644 (file)
@@ -22,9 +22,11 @@ namespace simgrid {
 
   LinkImpl* LinkImpl::byName(const char* name)
   {
-    if (links->find(name) == links->end())
+    try {
+      return links->at(name);
+    } catch (std::out_of_range& unfound) {
       return nullptr;
-    return links->at(name);
+    }
   }
   /** @brief Returns the amount of links in the platform */
   int LinkImpl::linksCount()