From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1914) id 254AB3857C7F; Fri, 7 Jan 2022 16:27:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 254AB3857C7F MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Pierre-Marie de Rodat To: gcc-cvs@gcc.gnu.org Subject: [gcc r12-6350] [Ada] Remove unnecessary guards for appending non-empty lists X-Act-Checkin: gcc X-Git-Author: Piotr Trojanek X-Git-Refname: refs/heads/master X-Git-Oldrev: 34b8a9b8c094a43566fe4fbe0f9252dcd4d92e70 X-Git-Newrev: 3174b67eefb20421d43a6c96473fe41ee4cd1bf9 Message-Id: <20220107162724.254AB3857C7F@sourceware.org> Date: Fri, 7 Jan 2022 16:27:24 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Jan 2022 16:27:24 -0000 https://gcc.gnu.org/g:3174b67eefb20421d43a6c96473fe41ee4cd1bf9 commit r12-6350-g3174b67eefb20421d43a6c96473fe41ee4cd1bf9 Author: Piotr Trojanek Date: Mon Dec 13 16:53:23 2021 +0100 [Ada] Remove unnecessary guards for appending non-empty lists gcc/ada/ * exp_ch3.adb (Build_Init_Procedure): Remove unnecessary guard. * exp_disp.adb (Make_DT): Likewise. * sem_ch12.adb (Analyze_Associations): Likewise. Diff: --- gcc/ada/exp_ch3.adb | 4 +--- gcc/ada/exp_disp.adb | 4 +--- gcc/ada/sem_ch12.adb | 4 +--- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/gcc/ada/exp_ch3.adb b/gcc/ada/exp_ch3.adb index 265799115c6..e3f5d48dfa8 100644 --- a/gcc/ada/exp_ch3.adb +++ b/gcc/ada/exp_ch3.adb @@ -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; diff --git a/gcc/ada/exp_disp.adb b/gcc/ada/exp_disp.adb index 2ea8d585215..7396c3e0335 100644 --- a/gcc/ada/exp_disp.adb +++ b/gcc/ada/exp_disp.adb @@ -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 diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb index fe55c5c20b1..be928742824 100644 --- a/gcc/ada/sem_ch12.adb +++ b/gcc/ada/sem_ch12.adb @@ -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;