From: Piotr Trojanek Date: Fri, 8 Jan 2021 16:01:27 +0000 (+0100) Subject: [Ada] Remove redundant check in iteration over formal parameters X-Git-Tag: basepoints/gcc-13~7834 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=61b54320da90358a010e93b086230ca0627a8fe6;p=thirdparty%2Fgcc.git [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. --- diff --git a/gcc/ada/freeze.adb b/gcc/ada/freeze.adb index cb3b0373d6a2..806677a97862 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