]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Remove redundant guard against empty list of declarations
authorPiotr Trojanek <trojanek@adacore.com>
Mon, 22 Aug 2022 19:36:11 +0000 (21:36 +0200)
committerMarc Poulhiès <poulhies@adacore.com>
Tue, 7 May 2024 07:55:58 +0000 (09:55 +0200)
Code cleanup.

gcc/ada/

* inline.adb (Has_Single_Return): Remove redundant check for
empty list, because First works also for empty list.

gcc/ada/inline.adb

index 169a22c0ba5db5ed902c78238e33f463b253e5ff..a628a59e14515d22fc371fccd5cfc0f37add1c43 100644 (file)
@@ -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)));