Skip to content
This repository was archived by the owner on May 18, 2019. It is now read-only.

Commit 398f563

Browse files
vwaurichOpenModelica-Hudson
authored andcommitted
dont order partitions if there are none
1 parent 3a94441 commit 398f563

1 file changed

Lines changed: 10 additions & 9 deletions

File tree

Compiler/BackEnd/SynchronousFeatures.mo

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -673,15 +673,16 @@ algorithm
673673
fail();
674674
end if;
675675

676-
//order the partitions according to their causality order and corresponding subclock order
677-
outSysts_noOrder := arrayCreate(listLength(outSysts), listHead(outSysts));
678-
for i in List.intRange(arrayLength(order)) loop
679-
outSys := listGet(outSysts,i);
680-
outSys.partitionKind := BackendDAE.CLOCKED_PARTITION(order[i] + off);
681-
arrayUpdate(outSysts_noOrder, order[i], outSys);
682-
end for;
683-
//(outSysts, _) := List.map2Fold(outSysts, makeClockedSyst, order, off, 1);
684-
outSysts := arrayList(outSysts_noOrder);
676+
if (not listEmpty(outSysts)) then
677+
//order the partitions according to their causality order and corresponding subclock order
678+
outSysts_noOrder := arrayCreate(listLength(outSysts), listHead(outSysts));
679+
for i in List.intRange(arrayLength(order)) loop
680+
outSys := listGet(outSysts,i);
681+
outSys.partitionKind := BackendDAE.CLOCKED_PARTITION(order[i] + off);
682+
arrayUpdate(outSysts_noOrder, order[i], outSys);
683+
end for;
684+
outSysts := arrayList(outSysts_noOrder);
685+
end if;
685686

686687
outSubClocks := {};
687688
subclocksOutArr := arrayCopy(subclocks);

0 commit comments

Comments
 (0)