]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Minor cosmetic refactoring
authorMarc Poulhiès <poulhies@adacore.com>
Thu, 23 Apr 2026 09:27:58 +0000 (11:27 +0200)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Thu, 4 Jun 2026 08:42:17 +0000 (10:42 +0200)
Rewrite the sequence of:
 if V = Enum_1
   or else V = Enum_2
   or else V in Enum_R
   ...

with a membership test.

gcc/ada/ChangeLog:

* sem_util.adb (Enclosing_Declaration): Refactor membership test.

gcc/ada/sem_util.adb

index f8f18d3d48bd686794a71827a3ee63c05f514ff3..60973af61cff88488553a6aeaf10cf03974b737c 100644 (file)
@@ -7664,13 +7664,11 @@ package body Sem_Util is
 
    begin
       while Present (Decl)
-        and then not (Nkind (Decl) in N_Declaration
-                        or else
-                      Nkind (Decl) in N_Later_Decl_Item
-                        or else
-                      Nkind (Decl) in N_Renaming_Declaration
-                        or else
-                      Nkind (Decl) = N_Number_Declaration)
+            and then not (Nkind (Decl) in
+              N_Declaration
+              | N_Later_Decl_Item
+              | N_Renaming_Declaration
+              | N_Number_Declaration)
       loop
          Decl := Parent (Decl);
       end loop;