]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Simplify manipulation of the list with loop actions
authorPiotr Trojanek <trojanek@adacore.com>
Fri, 5 Jul 2024 15:16:36 +0000 (17:16 +0200)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Fri, 2 Aug 2024 07:08:10 +0000 (09:08 +0200)
Code cleanup; behavior is unaffected.

gcc/ada/

* exp_aggr.adb (Add_Loop_Actions): Change manipulation of list
to avoid unnecessary calls to Parent and Loop_Actions.

gcc/ada/exp_aggr.adb

index 7a2d0570dbd4c1737ac9429a480f7bf7c7f70a1d..8496fcd9b0029b76dbb932795d2964dfbd6e30fb 100644 (file)
@@ -1262,9 +1262,9 @@ package body Exp_Aggr is
             elsif Nkind (Parent (Expr)) = N_Component_Association
               and then Present (Loop_Actions (Parent (Expr)))
             then
-               Append_List (Lis, Loop_Actions (Parent (Expr)));
                Res := Loop_Actions (Parent (Expr));
                Set_Loop_Actions (Parent (Expr), No_List);
+               Append_List (Lis, To => Res);
                return Res;
 
             else