summaryrefslogtreecommitdiffstats
path: root/gcc/ada/a-szuzha.adb
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/a-szuzha.adb')
-rw-r--r--gcc/ada/a-szuzha.adb20
1 files changed, 4 insertions, 16 deletions
diff --git a/gcc/ada/a-szuzha.adb b/gcc/ada/a-szuzha.adb
index fe357c5ddec..13cb19b7dcd 100644
--- a/gcc/ada/a-szuzha.adb
+++ b/gcc/ada/a-szuzha.adb
@@ -27,26 +27,14 @@
-- This unit was originally developed by Matthew J Heaney. --
------------------------------------------------------------------------------
--- Note: source of this algorithm: GNAT.HTable.Hash (g-htable.adb)
+with System.String_Hash;
function Ada.Strings.Wide_Wide_Unbounded.Wide_Wide_Hash
(Key : Unbounded_Wide_Wide_String) return Containers.Hash_Type
is
use Ada.Containers;
-
- function Rotate_Left
- (Value : Hash_Type;
- Amount : Natural) return Hash_Type;
- pragma Import (Intrinsic, Rotate_Left);
-
- Tmp : Hash_Type;
-
+ function Hash is new System.String_Hash.Hash
+ (Wide_Wide_Character, Wide_Wide_String, Hash_Type);
begin
- Tmp := 0;
- for J in 1 .. Key.Last loop
- Tmp := Rotate_Left (Tmp, 3) +
- Wide_Wide_Character'Pos (Key.Reference (J));
- end loop;
-
- return Tmp;
+ return Hash (To_Wide_Wide_String (Key));
end Ada.Strings.Wide_Wide_Unbounded.Wide_Wide_Hash;
OpenPOWER on IntegriCloud