* [COMMITTED] ada: Remove redundant guard against empty list of declarations
@ 2024-05-07 8:00 Marc Poulhiès
0 siblings, 0 replies; only message in thread
From: Marc Poulhiès @ 2024-05-07 8:00 UTC (permalink / raw)
To: gcc-patches; +Cc: Piotr Trojanek
From: Piotr Trojanek <trojanek@adacore.com>
Code cleanup.
gcc/ada/
* inline.adb (Has_Single_Return): Remove redundant check for
empty list, because First works also for empty list.
Tested on x86_64-pc-linux-gnu, committed on master.
---
gcc/ada/inline.adb | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/gcc/ada/inline.adb b/gcc/ada/inline.adb
index 169a22c0ba5..a628a59e145 100644
--- a/gcc/ada/inline.adb
+++ b/gcc/ada/inline.adb
@@ -4809,8 +4809,7 @@ package body Inline is
else
return
- Present (Declarations (N))
- and then Present (First (Declarations (N)))
+ Present (First (Declarations (N)))
and then Nkind (First (Declarations (N))) = N_Object_Declaration
and then Entity (Expression (Return_Statement)) =
Defining_Identifier (First (Declarations (N)));
--
2.43.2
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-05-07 8:00 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-07 8:00 [COMMITTED] ada: Remove redundant guard against empty list of declarations 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).