]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Remove redundant guard against empty list of declarations
authorPiotr Trojanek <trojanek@adacore.com>
Thu, 20 Mar 2025 18:35:55 +0000 (19:35 +0100)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Thu, 4 Jun 2026 08:42:20 +0000 (10:42 +0200)
Code cleanup; when First is called on No_List, it intentionally returns Empty.

gcc/ada/ChangeLog:

* exp_ch9.adb (Scan_Declarations): Remove redundant guard.

gcc/ada/exp_ch9.adb

index 7c875448dc2fa57dcd5cdfdc2a4d1518bef2a9fa..c2fc6c8a284fae9b7af8079b6b597763578a98de 100644 (file)
@@ -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;