projects
/
platform
/
upstream
/
gcc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
131c9af
)
[Ada] Simplify code by reusing List_Length
author
Piotr Trojanek
<trojanek@adacore.com>
Wed, 19 May 2021 10:06:55 +0000
(12:06 +0200)
committer
Pierre-Marie de Rodat
<derodat@adacore.com>
Wed, 7 Jul 2021 16:23:14 +0000
(16:23 +0000)
gcc/ada/
* exp_disp.adb (CPP_Num_Prims): Reuse List_Length.
gcc/ada/exp_disp.adb
patch
|
blob
|
history
diff --git
a/gcc/ada/exp_disp.adb
b/gcc/ada/exp_disp.adb
index
a44af6a
..
e9d6e74
100644
(file)
--- 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;