Reverse "router" node predicate handling order to compensate for the replication at the past end

Make the behaviour inline with other tee-like nodes: order replicas
ascending along output connectors
This commit is contained in:
Vftdan 2024-08-18 18:03:46 +02:00
parent 7a0e351b3a
commit 58dc2cc84a
1 changed files with 3 additions and 3 deletions

View File

@ -11,9 +11,9 @@ static bool
handle_event(EventPositionBase * self, EventNode * event) handle_event(EventPositionBase * self, EventNode * event)
{ {
RouterGraphNode *node = DOWNCAST(RouterGraphNode, GraphNode, DOWNCAST(GraphNode, EventPositionBase, self)); RouterGraphNode *node = DOWNCAST(RouterGraphNode, GraphNode, DOWNCAST(GraphNode, EventPositionBase, self));
for (size_t i = 0; i < node->length; ++i) { for (ssize_t i = node->length - 1; i >= 0; --i) {
if (i >= node->as_GraphNode.outputs.length) { if ((size_t) i >= node->as_GraphNode.outputs.length) {
break; continue;
} }
if (event_predicate_apply(node->predicates[i], event) == EVPREDRES_ACCEPTED) { if (event_predicate_apply(node->predicates[i], event) == EVPREDRES_ACCEPTED) {
if (event_replicate(event, 1)) { if (event_replicate(event, 1)) {