aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPiotr Trojanek <trojanek@adacore.com>2021-01-08 17:01:27 +0100
committerPierre-Marie de Rodat <derodat@adacore.com>2021-05-05 04:18:58 -0400
commit61b54320da90358a010e93b086230ca0627a8fe6 (patch)
tree0a4c5b194a8cf833a699d29198d84e2a18da1ada
parent5e54a5cff4a7e3bd977c15849e431563eecd67ae (diff)
downloadgcc-61b54320da90358a010e93b086230ca0627a8fe6.zip
gcc-61b54320da90358a010e93b086230ca0627a8fe6.tar.gz
gcc-61b54320da90358a010e93b086230ca0627a8fe6.tar.bz2
[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.
-rw-r--r--gcc/ada/freeze.adb10
1 files 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