aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorPiotr Trojanek <trojanek@adacore.com>2021-05-19 12:06:55 +0200
committerPierre-Marie de Rodat <derodat@adacore.com>2021-07-07 16:23:14 +0000
commita7bb69067afdea57aadd10583342c315925d2cbd (patch)
tree12001d46b09a496e984b4e6748dc88b041df0e99 /gcc
parent131c9affbde6ed68d2c42a0bea8839e1ba8a9f7e (diff)
downloadgcc-a7bb69067afdea57aadd10583342c315925d2cbd.zip
gcc-a7bb69067afdea57aadd10583342c315925d2cbd.tar.gz
gcc-a7bb69067afdea57aadd10583342c315925d2cbd.tar.bz2
[Ada] Simplify code by reusing List_Length
gcc/ada/ * exp_disp.adb (CPP_Num_Prims): Reuse List_Length.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/exp_disp.adb14
1 files changed, 1 insertions, 13 deletions
diff --git a/gcc/ada/exp_disp.adb b/gcc/ada/exp_disp.adb
index a44af6a..e9d6e74 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;