Optimize setStatus(): only escalate to parent interface at boundaries of a partial solution

In all other cases internalToExternalMap().find(s) will fail anyway.
This commit is contained in:
Robert Haschke 2021-09-17 01:26:19 +02:00 committed by Michael Görner
parent 47d20984ae
commit 9da3a8055e

View File

@ -162,7 +162,7 @@ void ContainerBasePrivate::setStatus(const InterfaceState* s, InterfaceState::St
}
// if possible (i.e. if state s has an external counterpart), escalate setStatus to external interface
if (parent()) {
if (parent() && trajectories<dir>(*s).empty()) {
auto external{ internalToExternalMap().find(s) };
if (external != internalToExternalMap().end()) { // do we have an external state?
// only escalate if there is no other *enabled* internal state connected to the same external one