]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[Ada] Remove doubly-negated tests for empty lists
authorPiotr Trojanek <trojanek@adacore.com>
Mon, 10 Jan 2022 13:21:17 +0000 (14:21 +0100)
committerPierre-Marie de Rodat <derodat@adacore.com>
Mon, 9 May 2022 09:27:29 +0000 (09:27 +0000)
Replace "not Is_Non_Empty_List (...)" with "Is_Empty_List (...)".

Code cleanup; semantics is unaffected.

gcc/ada/

* exp_ch5.adb (Update_Choice_Index): Simplify condition.
* sem_ch8.adb (Attribute_Renaming): Likewise.

gcc/ada/exp_ch5.adb
gcc/ada/sem_ch8.adb

index b38e3f54f679d275faac2385e3802148d77fe94e..b78c127e7f4539d58b58d18ac578560d01134cdb 100644 (file)
@@ -3563,8 +3563,7 @@ package body Exp_Ch5 is
                         --  is ok here.
                         --
                         pragma Assert
-                          (not Is_Non_Empty_List
-                                 (Component_Associations (Pattern)));
+                          (Is_Empty_List (Component_Associations (Pattern)));
 
                         declare
                            Agg_Length : constant Node_Id :=
index e575602924621b3772f4d9c72c55e44fa1204307..c40e1243a207e7ecbc3ae87b2e9991a13f1ff500 100644 (file)
@@ -4532,7 +4532,7 @@ package body Sem_Ch8 is
       --  have at least one formal parameter, with the exceptions of the GNAT
       --  attribute 'Img, which GNAT treats as renameable.
 
-      if not Is_Non_Empty_List (Parameter_Specifications (Spec)) then
+      if Is_Empty_List (Parameter_Specifications (Spec)) then
          if Aname /= Name_Img then
             Error_Msg_N
               ("subprogram renaming an attribute must have formals", N);