]> gcc.gnu.org Git - gcc.git/commitdiff
[Ada] Simplify iteration over pending instantiations
authorPiotr Trojanek <trojanek@adacore.com>
Mon, 17 May 2021 21:06:56 +0000 (23:06 +0200)
committerPierre-Marie de Rodat <derodat@adacore.com>
Wed, 7 Jul 2021 16:23:11 +0000 (16:23 +0000)
gcc/ada/

* inline.adb (Instantiate_Bodies): Fix white in declaration.
(Remove_Dead_Instance): Change iteration from WHILE to FOR.

gcc/ada/inline.adb

index 589c0f3f16e46af6905c04b64f0d3a6acf213d93..6c330b2522b9b4fa79a0670ed44681ae4575ddab 100644 (file)
@@ -4806,7 +4806,7 @@ package body Inline is
          end if;
       end Instantiate_Body;
 
-      J, K  : Nat;
+      J, K : Nat;
       Info : Pending_Body_Info;
 
    --  Start of processing for Instantiate_Bodies
@@ -5153,17 +5153,12 @@ package body Inline is
    --------------------------
 
    procedure Remove_Dead_Instance (N : Node_Id) is
-      J : Int;
-
    begin
-      J := 0;
-      while J <= Pending_Instantiations.Last loop
+      for J in 0 .. Pending_Instantiations.Last loop
          if Pending_Instantiations.Table (J).Inst_Node = N then
             Pending_Instantiations.Table (J).Inst_Node := Empty;
             return;
          end if;
-
-         J := J + 1;
       end loop;
    end Remove_Dead_Instance;
 
This page took 0.066448 seconds and 5 git commands to generate.