From: Piotr Trojanek Date: Mon, 20 Mar 2023 14:47:29 +0000 (+0100) Subject: ada: Remove redundant protection against empty lists X-Git-Tag: basepoints/gcc-15~8794 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8bb536cc97645208482ec3303d1cf9f99f95b42c;p=thirdparty%2Fgcc.git ada: Remove redundant protection against empty lists Calls to First on No_List intentionally return Empty, so explicit guards against No_List are unnecessary. Code cleanup; semantics is unaffected. gcc/ada/ * sem_util.adb (Check_Function_Writable_Actuals): Remove guard against a membership test with no alternatives; simplify with a membership test. --- diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index a42b2dff60f1..34ea06432cf7 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -2882,9 +2882,7 @@ package body Sem_Util is Collect_Identifiers (Right_Opnd (N)); end if; - if Nkind (N) in N_In | N_Not_In - and then Present (Alternatives (N)) - then + if Nkind (N) in N_Membership_Test then Expr := First (Alternatives (N)); while Present (Expr) loop Collect_Identifiers (Expr);