https://gcc.gnu.org/g:9a71bf784841107b93db0d2015d35fd7264fc62a

commit r17-1316-g9a71bf784841107b93db0d2015d35fd7264fc62a
Author: Piotr Trojanek <[email protected]>
Date:   Thu Mar 20 19:35:55 2025 +0100

    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:
---
 gcc/ada/exp_ch9.adb | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/gcc/ada/exp_ch9.adb b/gcc/ada/exp_ch9.adb
index 7c875448dc2f..c2fc6c8a284f 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;

Reply via email to