X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/86ad7bacaf8c0b206a62bf87193ca6800006a854..c897fb0d193bbe081581d7ea7f579f04df1b5b5d:/src/kernel/routing/NetZoneImpl.cpp diff --git a/src/kernel/routing/NetZoneImpl.cpp b/src/kernel/routing/NetZoneImpl.cpp index 2b4a84d6aa..148680148e 100644 --- a/src/kernel/routing/NetZoneImpl.cpp +++ b/src/kernel/routing/NetZoneImpl.cpp @@ -260,16 +260,20 @@ bool NetZoneImpl::getBypassRoute(routing::NetPoint* src, routing::NetPoint* dst, for (int i = 0; i < max; i++) { if (i <= max_index_src && max <= max_index_dst) { key = {path_src.at(i)->netpoint_, path_dst.at(max)->netpoint_}; - if (bypassRoutes_.find(key) != bypassRoutes_.end()) { + try { bypassedRoute = bypassRoutes_.at(key); break; + } catch (std::out_of_range& unfound) { + // Do nothing } } if (max <= max_index_src && i <= max_index_dst) { key = {path_src.at(max)->netpoint_, path_dst.at(i)->netpoint_}; - if (bypassRoutes_.find(key) != bypassRoutes_.end()) { + try { bypassedRoute = bypassRoutes_.at(key); break; + } catch (std::out_of_range& unfound) { + // Do nothing } } } @@ -279,9 +283,11 @@ bool NetZoneImpl::getBypassRoute(routing::NetPoint* src, routing::NetPoint* dst, if (max <= max_index_src && max <= max_index_dst) { key = {path_src.at(max)->netpoint_, path_dst.at(max)->netpoint_}; - if (bypassRoutes_.find(key) != bypassRoutes_.end()) { + try { bypassedRoute = bypassRoutes_.at(key); break; + } catch (std::out_of_range& unfound) { + // Do nothing } } }