From a7bb69067afdea57aadd10583342c315925d2cbd Mon Sep 17 00:00:00 2001 From: Piotr Trojanek Date: Wed, 19 May 2021 12:06:55 +0200 Subject: [PATCH] [Ada] Simplify code by reusing List_Length gcc/ada/ * exp_disp.adb (CPP_Num_Prims): Reuse List_Length. --- gcc/ada/exp_disp.adb | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/gcc/ada/exp_disp.adb b/gcc/ada/exp_disp.adb index a44af6a126e7..e9d6e744d2cf 100644 --- a/gcc/ada/exp_disp.adb +++ b/gcc/ada/exp_disp.adb @@ -588,19 +588,7 @@ package body Exp_Disp is -- Otherwise, count the primitives of the enclosing CPP type else - declare - Count : Nat := 0; - Elmt : Elmt_Id; - - begin - Elmt := First_Elmt (Primitive_Operations (CPP_Typ)); - while Present (Elmt) loop - Count := Count + 1; - Next_Elmt (Elmt); - end loop; - - return Count; - end; + return List_Length (Primitive_Operations (CPP_Typ)); end if; end if; end CPP_Num_Prims; -- 2.47.2