diff options
author | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-06-30 05:27:25 +0000 |
---|---|---|
committer | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-06-30 05:27:25 +0000 |
commit | 125da2199fbe37d73f566834eaf8528ee36f18e1 (patch) | |
tree | ff221cf3fd6ff96b14dcaf091dbf512b2752502b /gcc/ada/a-swbwha.adb | |
parent | 1d34abac81450ec8b2e2874b91318c6abdc4e5ac (diff) | |
download | gcc-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.adb | 20 |
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; |