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

Commit d30d68c

Browse files
hkielOpenModelica-Hudson
authored andcommitted
do not recreate Option
1 parent 12c7c7f commit d30d68c

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

Compiler/BackEnd/BackendDAECreate.mo

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1013,14 +1013,14 @@ algorithm
10131013
s1 = listHead(inNames);
10141014
namee1 = Absyn.joinPaths(inPath, Absyn.IDENT(s1));
10151015
then
1016-
DAEUtil.setMinMax(inVarAttr, SOME(DAE.ENUM_LITERAL(namee1, 1)), SOME(e));
1016+
DAEUtil.setMinMax(inVarAttr, SOME(DAE.ENUM_LITERAL(namee1, 1)), inMax);
10171017
case (SOME(e), NONE(), _, _, _)
10181018
equation
10191019
i = listLength(inNames);
10201020
sn = listGet(inNames, i);
10211021
nameen = Absyn.joinPaths(inPath, Absyn.IDENT(sn));
10221022
then
1023-
DAEUtil.setMinMax(inVarAttr, SOME(e), SOME(DAE.ENUM_LITERAL(nameen, i)));
1023+
DAEUtil.setMinMax(inVarAttr, inMin, SOME(DAE.ENUM_LITERAL(nameen, i)));
10241024
else inVarAttr;
10251025
end matchcontinue;
10261026
end setMinMaxFromEnumeration1;

Compiler/Util/Graph.mo

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -718,7 +718,7 @@ algorithm
718718
indexes = List.map3(nodes, findIndexofNodeInGraph, inGraph, inEqualFunc, 1);
719719
indexes = List.select1(indexes, arrayElemetGtZero, inColored);
720720
indexesColor = List.map1(indexes, getArrayElem, inColored);
721-
List.map2_0(indexesColor, arrayUpdateListAppend, forbiddenColor, inNode);
721+
List.map2_0(indexesColor, arrayUpdateListAppend, forbiddenColor, SOME({inNode}));
722722
forbiddenColor1 = addForbiddenColors(inNode, rest, inColored, forbiddenColor, inGraph, inEqualFunc, inPrintFunc);
723723
then forbiddenColor1;
724724
else
@@ -740,17 +740,17 @@ end getArrayElem;
740740
protected function arrayUpdateListAppend
741741
input Integer inIndex;
742742
input array<Option<list<NodeType>>> inArray;
743-
input NodeType inNode;
743+
input Option<list<NodeType>> inNode;
744744
replaceable type NodeType subtypeof Any;
745745
protected
746746
list<NodeType> arrayElem;
747747
algorithm
748-
_ := matchcontinue(inIndex, inArray, inNode)
748+
_ := matchcontinue(inIndex, inArray)
749749
local
750750
list<NodeType> arrElem;
751-
case (_, _, _)
751+
case (_, _)
752752
equation
753-
arrayUpdate(inArray, inIndex, SOME({inNode}));
753+
arrayUpdate(inArray, inIndex, inNode);
754754
then ();
755755
else
756756
equation
@@ -999,11 +999,12 @@ protected function updateForbiddenColorArrayInt
999999
input Integer inNode;
10001000
protected
10011001
Integer colorIndex;
1002+
Option<list<Integer>> opt = SOME({inNode});
10021003
algorithm
10031004
for index in inIndexes loop
10041005
colorIndex := arrayGet(inColored, index);
10051006
if colorIndex > 0 then
1006-
arrayUpdate(inForbiddenColor, colorIndex, SOME({inNode}));
1007+
arrayUpdate(inForbiddenColor, colorIndex, opt);
10071008
end if;
10081009
end for;
10091010
end updateForbiddenColorArrayInt;

0 commit comments

Comments
 (0)