summaryrefslogtreecommitdiff
path: root/gcc/ada/a-swbwha.adb
diff options
context:
space:
mode:
authorbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2009-06-30 05:27:25 +0000
committerbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2009-06-30 05:27:25 +0000
commit125da2199fbe37d73f566834eaf8528ee36f18e1 (patch)
treeff221cf3fd6ff96b14dcaf091dbf512b2752502b /gcc/ada/a-swbwha.adb
parent1d34abac81450ec8b2e2874b91318c6abdc4e5ac (diff)
downloadgcc-125da2199fbe37d73f566834eaf8528ee36f18e1.tar.gz
2009-06-29 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk r149060 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@149081 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/a-swbwha.adb')
-rw-r--r--gcc/ada/a-swbwha.adb20
1 files changed, 4 insertions, 16 deletions
diff --git a/gcc/ada/a-swbwha.adb b/gcc/ada/a-swbwha.adb
index a589036d3fc..643b5b0e654 100644
--- a/gcc/ada/a-swbwha.adb
+++ b/gcc/ada/a-swbwha.adb
@@ -27,27 +27,15 @@
-- 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_Bounded.Wide_Hash
(Key : Bounded.Bounded_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_Character, Wide_String, Hash_Type);
begin
- Tmp := 0;
- for J in 1 .. Bounded.Length (Key) loop
- Tmp := Rotate_Left (Tmp, 3) +
- Wide_Character'Pos (Bounded.Element (Key, J));
- end loop;
-
- return Tmp;
+ return Hash (Bounded.To_Wide_String (Key));
end Ada.Strings.Wide_Bounded.Wide_Hash;