Skip to content

Commit

Permalink
Special case for list intersection
Browse files Browse the repository at this point in the history
  • Loading branch information
sjoelund authored and OpenModelica-Hudson committed Apr 10, 2016
1 parent e64e95f commit a10e5cd
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Compiler/Util/List.mo
Expand Up @@ -1628,6 +1628,13 @@ public function intersection1OnTrue<T>
protected
Option<T> oe;
algorithm
if listEmpty(inList1) then
return;
end if;
if listEmpty(inList2) then
outList1Rest := inList1;
return;
end if;
for e in inList1 loop
if isMemberOnTrue(e, inList2, inCompFunc) then
outIntersection := e :: outIntersection;
Expand Down

0 comments on commit a10e5cd

Please sign in to comment.