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

Commit

Permalink
do not use matchcontinue where match+guard can be used
Browse files Browse the repository at this point in the history
Belonging to [master]:
  - #1974
  • Loading branch information
hkiel authored and OpenModelica-Hudson committed Nov 4, 2017
1 parent 75a3089 commit 0a53c4f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Compiler/FrontEnd/InstVar.mo
Original file line number Diff line number Diff line change
Expand Up @@ -1329,29 +1329,29 @@ protected function stripRecordDefaultBindingsFromElement
output DAE.Element outVar;
output list<DAE.Element> outEqs;
algorithm
(outVar, outEqs) := matchcontinue (inVar, inEqs)
(outVar, outEqs) := match (inVar, inEqs)
local
DAE.ComponentRef var_cr, eq_cr;
list<DAE.Element> rest_eqs;

case (DAE.VAR(componentRef = var_cr),
DAE.EQUATION(exp = DAE.CREF(componentRef = eq_cr)) :: rest_eqs)
equation
true = ComponentReference.crefEqual(var_cr, eq_cr);
guard
ComponentReference.crefEqual(var_cr, eq_cr)
// The first equation assigns the variable. Remove the variable's
// binding and discard the equation.
then
(DAEUtil.setElementVarBinding(inVar, NONE()), rest_eqs);

case (DAE.VAR(componentRef = var_cr),
DAE.COMPLEX_EQUATION(lhs = DAE.CREF(componentRef = eq_cr)) :: _)
algorithm
true := ComponentReference.crefPrefixOf(eq_cr, var_cr);
guard
ComponentReference.crefPrefixOf(eq_cr, var_cr)
then
(DAEUtil.setElementVarBinding(inVar, NONE()), inEqs);

else (inVar, inEqs);
end matchcontinue;
end match;
end stripRecordDefaultBindingsFromElement;

protected function checkDimensionGreaterThanZero
Expand Down

0 comments on commit 0a53c4f

Please sign in to comment.