From: Piotr Trojanek Date: Wed, 19 May 2021 10:06:55 +0000 (+0200) Subject: [Ada] Simplify code by reusing List_Length X-Git-Tag: basepoints/gcc-13~6202 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a7bb69067afdea57aadd10583342c315925d2cbd;p=thirdparty%2Fgcc.git [Ada] Simplify code by reusing List_Length gcc/ada/ * exp_disp.adb (CPP_Num_Prims): Reuse List_Length. --- 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;