Skip to content

Commit 791bc88

Browse files
committed
- Changed Util.swap to work as expected (i.e. swap on true).
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@13078 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
1 parent eef66f9 commit 791bc88

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

Compiler/Util/Util.mo

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3491,10 +3491,8 @@ public function swap
34913491
replaceable type A subtypeof Any;
34923492
algorithm
34933493
(out1,out2) := match (cond,in1,in2)
3494-
local
3495-
A a1,a2;
3496-
case (true,a1,a2) then (a1,a2);
3497-
case (false,a2,a1) then (a1,a2);
3494+
case (true, _, _) then (in2, in1);
3495+
else (in1, in2);
34983496
end match;
34993497
end swap;
35003498

0 commit comments

Comments
 (0)