aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/a-cgcaso.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2008-04-08 08:44:51 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2008-04-08 08:44:51 +0200
commit1ed69f611a49303c68258905e067c1c5888b9248 (patch)
tree2b9618595abf244d6ac1c4834b62e41355ec9377 /gcc/ada/a-cgcaso.adb
parent43c6e0cb2115c752aaa0d7dbc9f04587cb43f350 (diff)
downloadgcc-1ed69f611a49303c68258905e067c1c5888b9248.zip
gcc-1ed69f611a49303c68258905e067c1c5888b9248.tar.gz
gcc-1ed69f611a49303c68258905e067c1c5888b9248.tar.bz2
a-cgcaso.adb, [...]: (Swap, Sift): Avoid use of complex renaming.
2008-04-08 Arnaud Charlet <charlet@adacore.com> Matthew Heaney <heaney@adacore.com> * a-cgcaso.adb, a-convec.adb: (Swap, Sift): Avoid use of complex renaming. * a-cgaaso.ads, a-secain.ads, a-slcain.ads, a-shcain.ads, a-crdlli.ads, a-coormu.ads, a-ciormu.ads: modified header to conform to convention for non-RM specs. Add descriptive header, and documented each operation document each operation From-SVN: r134009
Diffstat (limited to 'gcc/ada/a-cgcaso.adb')
-rw-r--r--gcc/ada/a-cgcaso.adb19
1 files changed, 6 insertions, 13 deletions
diff --git a/gcc/ada/a-cgcaso.adb b/gcc/ada/a-cgcaso.adb
index ff7cdba..747c2a9 100644
--- a/gcc/ada/a-cgcaso.adb
+++ b/gcc/ada/a-cgcaso.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2004-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -91,14 +91,11 @@ is
while C /= S loop
declare
- Father : constant T := C / 2;
- Father_Elem : Element_Type renames A (To_Index (Father));
-
+ Father : constant T := C / 2;
begin
- if Father_Elem < Temp then -- Lt (Father, 0)
- A (To_Index (C)) := Father_Elem; -- Move (Father, C)
+ if A (To_Index (Father)) < Temp then -- Lt (Father, 0)
+ A (To_Index (C)) := A (To_Index (Father)); -- Move (Father, C)
C := Father;
-
else
exit;
end if;
@@ -117,12 +114,8 @@ begin
end loop;
while Max > 1 loop
- declare
- Max_Elem : Element_Type renames A (To_Index (Max));
- begin
- Temp := Max_Elem; -- Move (Max, 0);
- Max_Elem := A (A'First); -- Move (1, Max);
- end;
+ Temp := A (To_Index (Max)); -- Move (Max, 0);
+ A (To_Index (Max)) := A (A'First); -- Move (1, Max);
Max := Max - 1;
Sift (1);