[Ada] Remove redundant check in iteration over formal parameters
authorPiotr Trojanek <trojanek@adacore.com>
Fri, 8 Jan 2021 16:01:27 +0000 (17:01 +0100)
committerPierre-Marie de Rodat <derodat@adacore.com>
Wed, 5 May 2021 08:18:58 +0000 (04:18 -0400)
gcc/ada/

* freeze.adb (Build_Renamed_Body): Simplify IF and WHILE
statements with the same condition.

gcc/ada/freeze.adb

index cb3b037..806677a 100644 (file)
@@ -478,12 +478,10 @@ package body Freeze is
          Actuals := No_List;
       end if;
 
-      if Present (Formal) then
-         while Present (Formal) loop
-            Append (New_Occurrence_Of (Formal, Loc), Actuals);
-            Next_Formal (Formal);
-         end loop;
-      end if;
+      while Present (Formal) loop
+         Append (New_Occurrence_Of (Formal, Loc), Actuals);
+         Next_Formal (Formal);
+      end loop;
 
       --  If the renamed entity is an entry, inherit its profile. For other
       --  renamings as bodies, both profiles must be subtype conformant, so it