aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPiotr Trojanek <trojanek@adacore.com>2023-03-17 14:10:32 +0100
committerMarc Poulhiès <poulhies@adacore.com>2023-05-26 09:29:16 +0200
commit8cb3fcc43818344002e38ea78979b77b62649906 (patch)
tree4fdc71b3daae97418fafe7e7b90117483196e3fd
parent1a9c7e9ca214d107b52d4ecd6cbb54b3bea62158 (diff)
downloadgcc-8cb3fcc43818344002e38ea78979b77b62649906.zip
gcc-8cb3fcc43818344002e38ea78979b77b62649906.tar.gz
gcc-8cb3fcc43818344002e38ea78979b77b62649906.tar.bz2
ada: Remove redundant guards from handling of record components
Call to First on empty list is intentionally returning Empty. gcc/ada/ * sem_util.adb (Gather_Components): Remove guard for empty list of components.
-rw-r--r--gcc/ada/sem_util.adb7
1 files changed, 1 insertions, 6 deletions
diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb
index ea5be2f..d0e0fcd 100644
--- a/gcc/ada/sem_util.adb
+++ b/gcc/ada/sem_util.adb
@@ -9748,14 +9748,9 @@ package body Sem_Util is
if No (Comp_List) or else Null_Present (Comp_List) then
return;
-
- elsif Present (Component_Items (Comp_List)) then
- Comp_Item := First (Component_Items (Comp_List));
-
- else
- Comp_Item := Empty;
end if;
+ Comp_Item := First (Component_Items (Comp_List));
while Present (Comp_Item) loop
-- Skip the tag of a tagged record, as well as all items that are not