]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Remove redundant guards from handling of record components
authorPiotr Trojanek <trojanek@adacore.com>
Fri, 17 Mar 2023 13:10:32 +0000 (14:10 +0100)
committerMarc Poulhiès <poulhies@adacore.com>
Fri, 26 May 2023 07:29:16 +0000 (09:29 +0200)
Call to First on empty list is intentionally returning Empty.

gcc/ada/

* sem_util.adb (Gather_Components): Remove guard for empty list of
components.

gcc/ada/sem_util.adb

index ea5be2ff4b56a3ccc331863b6cf25a448909eb4d..d0e0fcd3da127a6da964b53c077a5760c6e6c0c9 100644 (file)
@@ -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