summaryrefslogtreecommitdiff
path: root/gcc/ada/a-cohama.adb
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/a-cohama.adb')
-rw-r--r--gcc/ada/a-cohama.adb16
1 files changed, 9 insertions, 7 deletions
diff --git a/gcc/ada/a-cohama.adb b/gcc/ada/a-cohama.adb
index 0616f4373ba..541e95a14e6 100644
--- a/gcc/ada/a-cohama.adb
+++ b/gcc/ada/a-cohama.adb
@@ -230,7 +230,8 @@ package body Ada.Containers.Hashed_Maps is
(Container : aliased Map;
Key : Key_Type) return Constant_Reference_Type
is
- Node : constant Node_Access := Key_Ops.Find (Container.HT, Key);
+ HT : Hash_Table_Type renames Container'Unrestricted_Access.HT;
+ Node : constant Node_Access := Key_Ops.Find (HT, Key);
begin
if Node = null then
@@ -238,7 +239,6 @@ package body Ada.Containers.Hashed_Maps is
end if;
declare
- HT : Hash_Table_Type renames Container'Unrestricted_Access.all.HT;
B : Natural renames HT.Busy;
L : Natural renames HT.Lock;
begin
@@ -351,7 +351,8 @@ package body Ada.Containers.Hashed_Maps is
-------------
function Element (Container : Map; Key : Key_Type) return Element_Type is
- Node : constant Node_Access := Key_Ops.Find (Container.HT, Key);
+ HT : Hash_Table_Type renames Container'Unrestricted_Access.HT;
+ Node : constant Node_Access := Key_Ops.Find (HT, Key);
begin
if Node = null then
@@ -484,7 +485,8 @@ package body Ada.Containers.Hashed_Maps is
----------
function Find (Container : Map; Key : Key_Type) return Cursor is
- Node : constant Node_Access := Key_Ops.Find (Container.HT, Key);
+ HT : Hash_Table_Type renames Container'Unrestricted_Access.HT;
+ Node : constant Node_Access := Key_Ops.Find (HT, Key);
begin
if Node = null then
@@ -978,7 +980,8 @@ package body Ada.Containers.Hashed_Maps is
(Container : aliased in out Map;
Key : Key_Type) return Reference_Type
is
- Node : constant Node_Access := Key_Ops.Find (Container.HT, Key);
+ HT : Hash_Table_Type renames Container.HT;
+ Node : constant Node_Access := Key_Ops.Find (HT, Key);
begin
if Node = null then
@@ -986,7 +989,6 @@ package body Ada.Containers.Hashed_Maps is
end if;
declare
- HT : Hash_Table_Type renames Container'Unrestricted_Access.all.HT;
B : Natural renames HT.Busy;
L : Natural renames HT.Lock;
begin
@@ -1181,7 +1183,7 @@ package body Ada.Containers.Hashed_Maps is
return False;
end if;
- X := HT.Buckets (Key_Ops.Index (HT, Position.Node.Key));
+ X := HT.Buckets (Key_Ops.Checked_Index (HT, Position.Node.Key));
for J in 1 .. HT.Length loop
if X = Position.Node then