From 61b54320da90358a010e93b086230ca0627a8fe6 Mon Sep 17 00:00:00 2001 From: Piotr Trojanek Date: Fri, 8 Jan 2021 17:01:27 +0100 Subject: [PATCH] [Ada] Remove redundant check in iteration over formal parameters gcc/ada/ * freeze.adb (Build_Renamed_Body): Simplify IF and WHILE statements with the same condition. --- gcc/ada/freeze.adb | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/gcc/ada/freeze.adb b/gcc/ada/freeze.adb index cb3b037..806677a 100644 --- a/gcc/ada/freeze.adb +++ b/gcc/ada/freeze.adb @@ -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 -- 2.7.4