summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwtc%netscape.com <devnull@localhost>2003-04-10 18:10:12 +0000
committerwtc%netscape.com <devnull@localhost>2003-04-10 18:10:12 +0000
commit46ea18e5e4d89fff1abae6bdb0d8a5ead07e267b (patch)
treefcaa2cf4b1b3d68067778ec6eb8f69548a23ff73
parent40e8b75635f838516dd95ec573be30a94224927d (diff)
downloadnspr-hg-46ea18e5e4d89fff1abae6bdb0d8a5ead07e267b.tar.gz
Explain how the GOLDEN_RATIO constant was calculated.
-rw-r--r--lib/ds/plhash.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/ds/plhash.c b/lib/ds/plhash.c
index f02b5132..8cfce081 100644
--- a/lib/ds/plhash.c
+++ b/lib/ds/plhash.c
@@ -179,7 +179,7 @@ PL_HashTableDestroy(PLHashTable *ht)
/*
** Multiplicative hash, from Knuth 6.4.
*/
-#define GOLDEN_RATIO 0x9E3779B9U
+#define GOLDEN_RATIO 0x9E3779B9U /* 2/(1+sqrt(5))*(2^32) */
PR_IMPLEMENT(PLHashEntry **)
PL_HashTableRawLookup(PLHashTable *ht, PLHashNumber keyHash, const void *key)