Commit 2b6cd962 by Claire Dross Committed by Pierre-Marie de Rodat

[Ada] Fix style issues in functional maps

Rename global constants from I to J. No functional changes.

2019-09-18  Claire Dross  <dross@adacore.com>

gcc/ada/

	* libgnat/a-cofuma.adb (Remove, Elements_Equal_Except,
	Keys_Included, Keys_Included_Except): Rename loop indexes and
	global constants from I to J.

From-SVN: r275838
parent 27785539
2019-09-18 Claire Dross <dross@adacore.com>
* libgnat/a-cofuma.adb (Remove, Elements_Equal_Except,
Keys_Included, Keys_Included_Except): Rename loop indexes and
global constants from I to J.
2019-09-18 Arnaud Charlet <charlet@adacore.com> 2019-09-18 Arnaud Charlet <charlet@adacore.com>
* exp_unst.adb (Unnest_Subprograms): Refine previous change. * exp_unst.adb (Unnest_Subprograms): Refine previous change.
......
...@@ -88,15 +88,15 @@ package body Ada.Containers.Functional_Maps with SPARK_Mode => Off is ...@@ -88,15 +88,15 @@ package body Ada.Containers.Functional_Maps with SPARK_Mode => Off is
New_Key : Key_Type) return Boolean New_Key : Key_Type) return Boolean
is is
begin begin
for I in 1 .. Length (Left.Keys) loop for J in 1 .. Length (Left.Keys) loop
declare declare
K : constant Key_Type := Get (Left.Keys, I); K : constant Key_Type := Get (Left.Keys, J);
begin begin
if not Equivalent_Keys (K, New_Key) if not Equivalent_Keys (K, New_Key)
and then and then
(Find (Right.Keys, K) = 0 (Find (Right.Keys, K) = 0
or else Get (Right.Elements, Find (Right.Keys, K)) /= or else Get (Right.Elements, Find (Right.Keys, K)) /=
Get (Left.Elements, I)) Get (Left.Elements, J))
then then
return False; return False;
end if; end if;
...@@ -112,16 +112,16 @@ package body Ada.Containers.Functional_Maps with SPARK_Mode => Off is ...@@ -112,16 +112,16 @@ package body Ada.Containers.Functional_Maps with SPARK_Mode => Off is
Y : Key_Type) return Boolean Y : Key_Type) return Boolean
is is
begin begin
for I in 1 .. Length (Left.Keys) loop for J in 1 .. Length (Left.Keys) loop
declare declare
K : constant Key_Type := Get (Left.Keys, I); K : constant Key_Type := Get (Left.Keys, J);
begin begin
if not Equivalent_Keys (K, X) if not Equivalent_Keys (K, X)
and then not Equivalent_Keys (K, Y) and then not Equivalent_Keys (K, Y)
and then and then
(Find (Right.Keys, K) = 0 (Find (Right.Keys, K) = 0
or else Get (Right.Elements, Find (Right.Keys, K)) /= or else Get (Right.Elements, Find (Right.Keys, K)) /=
Get (Left.Elements, I)) Get (Left.Elements, J))
then then
return False; return False;
end if; end if;
...@@ -173,9 +173,9 @@ package body Ada.Containers.Functional_Maps with SPARK_Mode => Off is ...@@ -173,9 +173,9 @@ package body Ada.Containers.Functional_Maps with SPARK_Mode => Off is
function Keys_Included (Left : Map; Right : Map) return Boolean is function Keys_Included (Left : Map; Right : Map) return Boolean is
begin begin
for I in 1 .. Length (Left.Keys) loop for J in 1 .. Length (Left.Keys) loop
declare declare
K : constant Key_Type := Get (Left.Keys, I); K : constant Key_Type := Get (Left.Keys, J);
begin begin
if Find (Right.Keys, K) = 0 then if Find (Right.Keys, K) = 0 then
return False; return False;
...@@ -196,9 +196,9 @@ package body Ada.Containers.Functional_Maps with SPARK_Mode => Off is ...@@ -196,9 +196,9 @@ package body Ada.Containers.Functional_Maps with SPARK_Mode => Off is
New_Key : Key_Type) return Boolean New_Key : Key_Type) return Boolean
is is
begin begin
for I in 1 .. Length (Left.Keys) loop for J in 1 .. Length (Left.Keys) loop
declare declare
K : constant Key_Type := Get (Left.Keys, I); K : constant Key_Type := Get (Left.Keys, J);
begin begin
if not Equivalent_Keys (K, New_Key) if not Equivalent_Keys (K, New_Key)
and then Find (Right.Keys, K) = 0 and then Find (Right.Keys, K) = 0
...@@ -218,9 +218,9 @@ package body Ada.Containers.Functional_Maps with SPARK_Mode => Off is ...@@ -218,9 +218,9 @@ package body Ada.Containers.Functional_Maps with SPARK_Mode => Off is
Y : Key_Type) return Boolean Y : Key_Type) return Boolean
is is
begin begin
for I in 1 .. Length (Left.Keys) loop for J in 1 .. Length (Left.Keys) loop
declare declare
K : constant Key_Type := Get (Left.Keys, I); K : constant Key_Type := Get (Left.Keys, J);
begin begin
if not Equivalent_Keys (K, X) if not Equivalent_Keys (K, X)
and then not Equivalent_Keys (K, Y) and then not Equivalent_Keys (K, Y)
...@@ -248,11 +248,11 @@ package body Ada.Containers.Functional_Maps with SPARK_Mode => Off is ...@@ -248,11 +248,11 @@ package body Ada.Containers.Functional_Maps with SPARK_Mode => Off is
------------ ------------
function Remove (Container : Map; Key : Key_Type) return Map is function Remove (Container : Map; Key : Key_Type) return Map is
I : constant Extended_Index := Find (Container.Keys, Key); J : constant Extended_Index := Find (Container.Keys, Key);
begin begin
return return
(Keys => Remove (Container.Keys, I), (Keys => Remove (Container.Keys, J),
Elements => Remove (Container.Elements, I)); Elements => Remove (Container.Elements, J));
end Remove; end Remove;
--------------- ---------------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment