summaryrefslogtreecommitdiff
path: root/gcc/ada/a-cbhama.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2011-12-02 14:36:31 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2011-12-02 14:36:31 +0000
commit6ccc084d6821be9284cfcf7e62f61262979763eb (patch)
tree452ea8a651cc68cbc0204b035b9961cbe4a75820 /gcc/ada/a-cbhama.adb
parent8be7beddd31374cd4581f035afc378e0c40d8728 (diff)
downloadgcc-6ccc084d6821be9284cfcf7e62f61262979763eb.tar.gz
2011-12-02 Matthew Heaney <heaney@adacore.com>
* a-coormu.ads, a-ciormu.ads: Declare iterator factory function. * a-ciormu.adb, a-ciormu.adb (Iterator): Declare concrete Iterator type. (Finalize): Decrement busy counter. (First, Last): Cursor return value depends on iterator node value. (Iterate): Use start position as iterator node value. (Next, Previous): Forward to corresponding cursor-based operation. 2011-12-02 Robert Dewar <dewar@adacore.com> * a-cborma.adb, a-cbhama.adb, a-cbdlli.adb, a-cbmutr.adb, a-cbhase.adb, a-cdlili.adb, a-cihama.adb, a-ciorse.adb, a-cidlli.adb, a-cimutr.adb, a-cihase.adb, a-cohama.adb, a-cborse.adb, a-ciorma.adb, a-cobove.adb: Minor reformatting. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@181912 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/a-cbhama.adb')
-rw-r--r--gcc/ada/a-cbhama.adb19
1 files changed, 8 insertions, 11 deletions
diff --git a/gcc/ada/a-cbhama.adb b/gcc/ada/a-cbhama.adb
index 471193079b5..d52aea05376 100644
--- a/gcc/ada/a-cbhama.adb
+++ b/gcc/ada/a-cbhama.adb
@@ -35,6 +35,7 @@ pragma Elaborate_All (Ada.Containers.Hash_Tables.Generic_Bounded_Keys);
with Ada.Containers.Prime_Numbers; use Ada.Containers.Prime_Numbers;
with Ada.Finalization; use Ada.Finalization;
+
with System; use type System.Address;
package body Ada.Containers.Bounded_Hashed_Maps is
@@ -405,7 +406,6 @@ package body Ada.Containers.Bounded_Hashed_Maps is
if Object.Container /= null then
declare
B : Natural renames Object.Container.all.Busy;
-
begin
B := B - 1;
end;
@@ -418,13 +418,12 @@ package body Ada.Containers.Bounded_Hashed_Maps is
function Find (Container : Map; Key : Key_Type) return Cursor is
Node : constant Count_Type := Key_Ops.Find (Container, Key);
-
begin
if Node = 0 then
return No_Element;
+ else
+ return Cursor'(Container'Unrestricted_Access, Node);
end if;
-
- return Cursor'(Container'Unrestricted_Access, Node);
end Find;
-----------
@@ -433,13 +432,12 @@ package body Ada.Containers.Bounded_Hashed_Maps is
function First (Container : Map) return Cursor is
Node : constant Count_Type := HT_Ops.First (Container);
-
begin
if Node = 0 then
return No_Element;
+ else
+ return Cursor'(Container'Unrestricted_Access, Node);
end if;
-
- return Cursor'(Container'Unrestricted_Access, Node);
end First;
function First (Object : Iterator) return Cursor is
@@ -489,7 +487,6 @@ package body Ada.Containers.Bounded_Hashed_Maps is
declare
N : Node_Type renames Container.Nodes (Position.Node);
-
begin
N.Key := Key;
N.Element := New_Item;
@@ -532,6 +529,7 @@ package body Ada.Containers.Bounded_Hashed_Maps is
-- parameter.
-- Node.Element := New_Item;
+ -- What is this deleted code about???
end Assign_Key;
--------------
@@ -768,13 +766,12 @@ package body Ada.Containers.Bounded_Hashed_Maps is
declare
M : Map renames Position.Container.all;
Node : constant Count_Type := HT_Ops.Next (M, Position.Node);
-
begin
if Node = 0 then
return No_Element;
+ else
+ return Cursor'(Position.Container, Node);
end if;
-
- return Cursor'(Position.Container, Node);
end;
end Next;