diff options
author | Piotr Trojanek <trojanek@adacore.com> | 2023-03-20 15:47:29 +0100 |
---|---|---|
committer | Marc Poulhiès <poulhies@adacore.com> | 2023-05-29 10:23:21 +0200 |
commit | 8bb536cc97645208482ec3303d1cf9f99f95b42c (patch) | |
tree | b7b2f350e9c903e7d13293f375e734b1499e0c9a /gcc | |
parent | 95349238568178b7152a89700766d033e4b23ca0 (diff) | |
download | gcc-8bb536cc97645208482ec3303d1cf9f99f95b42c.zip gcc-8bb536cc97645208482ec3303d1cf9f99f95b42c.tar.gz gcc-8bb536cc97645208482ec3303d1cf9f99f95b42c.tar.bz2 |
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.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/sem_util.adb | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index a42b2dff..34ea064 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); |