From: Piotr Trojanek <[email protected]>

Code cleanup; when First is called on No_List, it intentionally returns Empty.

gcc/ada/ChangeLog:

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

Tested on x86_64-pc-linux-gnu, committed on master.

---
 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 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;
-- 
2.53.0

Reply via email to