[Ada] Remove unnecessary guards for appending non-empty lists
authorPiotr Trojanek <trojanek@adacore.com>
Mon, 13 Dec 2021 15:53:23 +0000 (16:53 +0100)
committerPierre-Marie de Rodat <derodat@adacore.com>
Fri, 7 Jan 2022 16:24:07 +0000 (16:24 +0000)
gcc/ada/

* exp_ch3.adb (Build_Init_Procedure): Remove unnecessary guard.
* exp_disp.adb (Make_DT): Likewise.
* sem_ch12.adb (Analyze_Associations): Likewise.

gcc/ada/exp_ch3.adb
gcc/ada/exp_disp.adb
gcc/ada/sem_ch12.adb

index 2657991..e3f5d48 100644 (file)
@@ -2885,9 +2885,7 @@ package body Exp_Ch3 is
                   Fixed_Comps    => False,
                   Variable_Comps => True);
 
-               if Is_Non_Empty_List (Init_Tags_List) then
-                  Append_List_To (Body_Stmts, Init_Tags_List);
-               end if;
+               Append_List_To (Body_Stmts, Init_Tags_List);
             end if;
          end if;
 
index 2ea8d58..7396c3e 100644 (file)
@@ -6379,9 +6379,7 @@ package body Exp_Disp is
                New_List (New_Occurrence_Of (DT_Ptr, Loc))));
       end if;
 
-      if not Is_Empty_List (Elab_Code) then
-         Append_List_To (Result, Elab_Code);
-      end if;
+      Append_List_To (Result, Elab_Code);
 
       --  Populate the two auxiliary tables used for dispatching asynchronous,
       --  conditional and timed selects for synchronized types that implement
index fe55c5c..be92874 100644 (file)
@@ -2248,9 +2248,7 @@ package body Sem_Ch12 is
       --  explicit box associations for the formals that are covered by an
       --  Others_Choice.
 
-      if not Is_Empty_List (Default_Formals) then
-         Append_List (Default_Formals, Formals);
-      end if;
+      Append_List (Default_Formals, Formals);
 
       return Assoc_List;
    end Analyze_Associations;