public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r14-1267] ada: Remove redundant guards from handling of record components
@ 2023-05-26  7:36 Marc Poulhi?s
  0 siblings, 0 replies; only message in thread
From: Marc Poulhi?s @ 2023-05-26  7:36 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:8cb3fcc43818344002e38ea78979b77b62649906

commit r14-1267-g8cb3fcc43818344002e38ea78979b77b62649906
Author: Piotr Trojanek <trojanek@adacore.com>
Date:   Fri Mar 17 14:10:32 2023 +0100

    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.

Diff:
---
 gcc/ada/sem_util.adb | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb
index ea5be2ff4b5..d0e0fcd3da1 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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-05-26  7:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-26  7:36 [gcc r14-1267] ada: Remove redundant guards from handling of record components Marc Poulhi?s

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).