Skip to content

Commit

Permalink
Avoid matchcontinue
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@18945 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Feb 2, 2014
1 parent 5190e5e commit 7babbaf
Showing 1 changed file with 5 additions and 15 deletions.
20 changes: 5 additions & 15 deletions Compiler/Util/List.mo
Expand Up @@ -7132,22 +7132,12 @@ public function getMemberOnTrue
input ElementType inElement;
output Boolean outIsEqual;
end CompFunc;
protected
ElementType e;
list<ElementType> rest;
algorithm
outElement := matchcontinue(inValue, inList, inCompFunc)
local
ElementType e;
list<ElementType> rest;

case (_, e :: _, _)
equation
true = inCompFunc(inValue, e);
then
e;

case (_, _ :: rest, _)
then getMemberOnTrue(inValue, rest, inCompFunc);

end matchcontinue;
e :: rest := inList;
outElement := Debug.bcallret3(not inCompFunc(inValue, e), getMemberOnTrue, inValue, rest, inCompFunc, e);
end getMemberOnTrue;

public function notMember
Expand Down

0 comments on commit 7babbaf

Please sign in to comment.