From: Piotr Trojanek Date: Thu, 20 Mar 2025 18:35:55 +0000 (+0100) Subject: ada: Remove redundant guard against empty list of declarations X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=9a71bf784841107b93db0d2015d35fd7264fc62a;p=thirdparty%2Fgcc.git ada: Remove redundant guard against empty list of declarations Code cleanup; when First is called on No_List, it intentionally returns Empty. gcc/ada/ChangeLog: * exp_ch9.adb (Scan_Declarations): Remove redundant guard. --- diff --git a/gcc/ada/exp_ch9.adb b/gcc/ada/exp_ch9.adb index 7c875448dc2..c2fc6c8a284 100644 --- a/gcc/ada/exp_ch9.adb +++ b/gcc/ada/exp_ch9.adb @@ -2114,20 +2114,21 @@ package body Exp_Ch9 is is Def : Node_Id; Rec_Typ : Entity_Id; + procedure Scan_Declarations (L : List_Id); -- Common processing for visible and private declarations -- of a protected type. + ----------------------- + -- Scan_Declarations -- + ----------------------- + procedure Scan_Declarations (L : List_Id) is Decl : Node_Id; Wrap_Decl : Node_Id; Wrap_Spec : Node_Id; begin - if No (L) then - return; - end if; - Decl := First (L); while Present (Decl) loop Wrap_Spec := Empty;