diff options
author | Yannick Moy <moy@adacore.com> | 2022-02-24 17:30:36 +0100 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2022-05-13 08:04:41 +0000 |
commit | 4c9a8183b3469f50c9418a2309e56b37cbac9f9f (patch) | |
tree | 28c7c3b4bf906b1f675a91b4c935127ff6c0d99a /gcc/ada/libgnat/a-chtgfo.ads | |
parent | f8e12e78628238a9e3cf68ce9376aa2e28e0506f (diff) | |
download | gcc-4c9a8183b3469f50c9418a2309e56b37cbac9f9f.zip gcc-4c9a8183b3469f50c9418a2309e56b37cbac9f9f.tar.gz gcc-4c9a8183b3469f50c9418a2309e56b37cbac9f9f.tar.bz2 |
[Ada] Simplify helper units for formal hashed sets/maps
As tampering checks do not exist in formal hashed sets and maps, remove
the machinery for such checks in the version of generic key and node
operations for formal sets/maps. Update comments as well.
gcc/ada/
* libgnat/a-chtgfk.adb (Checked_Equivalent_Keys, Checked_Index):
Remove useless functions.
(Delete_Key_Sans_Free, Find, Generic_Conditional_Insert): Adapt
to removal of wrapper functions.
* libgnat/a-chtgfk.ads (Checked_Equivalent_Keys, Checked_Index):
Remove useless functions.
* libgnat/a-chtgfo.adb (Checked_Index): Remove useless function.
(Clear): Delete code commented out regarding Busy and Lock
management.
(Delete_Node_At_Index): Delete unused procedure.
(Delete_Node_Sans_Free, Free, Generic_Read, Next): Adapt to
removal of wrapper functions.
* libgnat/a-chtgfo.ads (Checked_Index): Remove useless function.
(Delete_Node_At_Index): Delete unused procedure.
Diffstat (limited to 'gcc/ada/libgnat/a-chtgfo.ads')
-rw-r--r-- | gcc/ada/libgnat/a-chtgfo.ads | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/gcc/ada/libgnat/a-chtgfo.ads b/gcc/ada/libgnat/a-chtgfo.ads index b20ef69..043b732 100644 --- a/gcc/ada/libgnat/a-chtgfo.ads +++ b/gcc/ada/libgnat/a-chtgfo.ads @@ -62,12 +62,6 @@ package Ada.Containers.Hash_Tables.Generic_Formal_Operations is -- Uses the hash value of Node to compute its Hash_Table buckets array -- index. - function Checked_Index - (Hash_Table : Hash_Table_Type; - Node : Count_Type) return Hash_Type; - -- Calls Index, but also locks and unlocks the container, per AI05-0022, in - -- order to detect element tampering by the generic actual Hash function. - generic with function Find (HT : Hash_Table_Type; @@ -80,19 +74,7 @@ package Ada.Containers.Hash_Tables.Generic_Formal_Operations is -- node then Generic_Equal returns True. procedure Clear (HT : in out Hash_Table_Type); - -- Deallocates each node in hash table HT. (Note that it only deallocates - -- the nodes, not the buckets array.) Program_Error is raised if the hash - -- table is busy. - - procedure Delete_Node_At_Index - (HT : in out Hash_Table_Type; - Indx : Hash_Type; - X : Count_Type); - -- Delete a node whose bucket position is known. extracted from following - -- subprogram, but also used directly to remove a node whose element has - -- been modified through a key_preserving reference: in that case we cannot - -- use the value of the element precisely because the current value does - -- not correspond to the hash code that determines its bucket. + -- Empties the hash table HT procedure Delete_Node_Sans_Free (HT : in out Hash_Table_Type; |