]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Remove unnecessary call to Detach.
authorVadim Godunko <godunko@adacore.com>
Wed, 15 Feb 2023 08:22:27 +0000 (12:22 +0400)
committerMarc Poulhiès <poulhies@adacore.com>
Tue, 23 May 2023 07:59:06 +0000 (09:59 +0200)
Holder object is constant and protected from modification by tampering
rules.

gcc/ada/

* libgnat/a-coinho__shared.adb (Constant_Reference): Remove call
of Detach
(Query_Element): Likewise.

gcc/ada/libgnat/a-coinho__shared.adb

index 367089048afb0aa3978df676d02529df2942331c..f49ac4ad8176702d763d8a32a32a84403b679e4d 100644 (file)
@@ -149,8 +149,6 @@ package body Ada.Containers.Indefinite_Holders is
          raise Constraint_Error with "container is empty";
       end if;
 
-      Detach (Container);
-
       declare
          Ref : constant Constant_Reference_Type :=
                  (Element => Container.Reference.Element.all'Access,
@@ -305,8 +303,6 @@ package body Ada.Containers.Indefinite_Holders is
          raise Constraint_Error with "container is empty";
       end if;
 
-      Detach (Container);
-
       B := B + 1;
 
       begin