]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Simplify copying of node lists
authorPiotr Trojanek <trojanek@adacore.com>
Tue, 7 Mar 2023 18:52:40 +0000 (19:52 +0100)
committerMarc Poulhiès <poulhies@adacore.com>
Thu, 25 May 2023 07:44:17 +0000 (09:44 +0200)
When creating a copy of a node list we called Copy_Entity for entities
and Copy_Separate_Tree for other nodes. This was unnecessary, because
the Copy_Separate_Tree when called on entities will just do Copy_Entity.

Code cleanup; semantics is unaffected.

gcc/ada/

* atree.adb (Copy_List): Call Copy_Separate_Tree for both entities and
other nodes.

gcc/ada/atree.adb

index 1c5b93727cd29f2e34c6f3483fb12808aedb4e83..ef19a80b6e76f33f0fe53a5e559ef9a3fb9c6d30 100644 (file)
@@ -1396,12 +1396,7 @@ package body Atree is
 
             E := First (List);
             while Present (E) loop
-               if Is_Entity (E) then
-                  Append (Copy_Entity (E), NL);
-               else
-                  Append (Copy_Separate_Tree (E), NL);
-               end if;
-
+               Append (Copy_Separate_Tree (E), NL);
                Next (E);
             end loop;