projects
/
ghc-base.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3a3de88
)
Fix haddock docs in Hashtable
author
Ian Lynagh
<igloo@earth.li>
Thu, 30 Aug 2007 15:41:31 +0000
(15:41 +0000)
committer
Ian Lynagh
<igloo@earth.li>
Thu, 30 Aug 2007 15:41:31 +0000
(15:41 +0000)
Data/HashTable.hs
patch
|
blob
|
history
diff --git
a/Data/HashTable.hs
b/Data/HashTable.hs
index
9711dd2
..
cb11e15
100644
(file)
--- a/
Data/HashTable.hs
+++ b/
Data/HashTable.hs
@@
-199,7
+199,9
@@
hashInt32 x = mulHi x golden + x
-- implemented by extracting the uppermost 32 bits of the 64-bit
-- result of multiplying by a 33-bit constant. The constant is from
-- Knuth, derived from the golden ratio:
+--
-- > golden = round ((sqrt 5 - 1) * 2^32)
+--
-- We get good key uniqueness on small inputs
-- (a problem with previous versions):
-- (length $ group $ sort $ map hashInt [-32767..65536]) == 65536 + 32768