Skip to content

Commit

Permalink
Renamed crefEqualStringCompare to crefEqualVerySlowStringCompareDoNotUse
Browse files Browse the repository at this point in the history
- crefEqual now uses crefEqualNoStringCompare
- only cppruntime uses crefEqualVerySlowStringCompareDoNotUse


git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@18944 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Feb 2, 2014
1 parent 6b9437c commit 5190e5e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Compiler/BackEnd/BackendDAEOptimize.mo
Expand Up @@ -8537,7 +8537,7 @@ algorithm
case(DAE.CREF(componentRef=cref),_)
equation
// just a cref
sameCref = ComponentReference.crefEqualStringCompare(crefIn,cref);
sameCref = ComponentReference.crefEqualNoStringCompare(crefIn,cref);
//print("its a cref \n"+&ComponentReference.printComponentRefStr(cref)+&"\n");
//print("is it the same CREF: "+&boolString(sameCref)+&"\n");
then
Expand Down
2 changes: 1 addition & 1 deletion Compiler/BackEnd/SimCodeUtil.mo
Expand Up @@ -11714,7 +11714,7 @@ algorithm
case((v as SimCode.SIMVAR(name, varKind, comment, unit, displayUnit, index, minValue, maxValue, initialValue, nominalValue, isFixed, type_, isDiscrete, arrayCref, aliasvar, source, causality, variable_index, numArrayElement,isValueChangeable)), SimCode.SIMVAR(name=name1, index=index1, variable_index=SOME(variable_index1))::_)
equation
Debug.fcall(Flags.FAILTRACE, BackendDump.debugStrCrefStrCrefStr, (" compare variable ", name, "with ", name1, "\n"));
true = ComponentReference.crefEqual(name, name1);
true = ComponentReference.crefEqualVerySlowStringCompareDoNotUse(name, name1);
then
SimCode.SIMVAR(name, varKind, comment, unit, displayUnit, variable_index1, minValue, maxValue, initialValue, nominalValue, isFixed, type_, isDiscrete, arrayCref, aliasvar, source, causality, SOME(index1), numArrayElement,isValueChangeable);
case( v, _::rest1)
Expand Down
8 changes: 4 additions & 4 deletions Compiler/FrontEnd/ComponentReference.mo
Expand Up @@ -876,10 +876,10 @@ public function crefEqual
input DAE.ComponentRef inComponentRef2;
output Boolean outBoolean;
algorithm
outBoolean := crefEqualStringCompare(inComponentRef1,inComponentRef2);
outBoolean := crefEqualNoStringCompare(inComponentRef1,inComponentRef2);
end crefEqual;

public function crefEqualStringCompare
public function crefEqualVerySlowStringCompareDoNotUse
"Returns true if two component references are equal,
comparing strings in no other solution is found"
input DAE.ComponentRef inComponentRef1;
Expand Down Expand Up @@ -935,7 +935,7 @@ algorithm
case (DAE.CREF_QUAL(ident = n1,subscriptLst = idx1,componentRef = cr1),DAE.CREF_QUAL(ident = n2,subscriptLst = idx2,componentRef = cr2))
equation
true = stringEq(n1, n2);
true = crefEqualStringCompare(cr1, cr2);
true = crefEqualVerySlowStringCompareDoNotUse(cr1, cr2);
true = Expression.subscriptEqual(idx1, idx2);
then
true;
Expand Down Expand Up @@ -981,7 +981,7 @@ algorithm
// the crefs are not equal!
case (_,_) then false;
end matchcontinue;
end crefEqualStringCompare;
end crefEqualVerySlowStringCompareDoNotUse;

public function crefEqualNoStringCompare
"Returns true if two component references are equal!
Expand Down

0 comments on commit 5190e5e

Please sign in to comment.