tweak PERL_HASH() to h=h+(h>>5) in order to improve distribution of
Gurusamy Sarathy [Thu, 24 Sep 1998 04:52:48 +0000 (04:52 +0000)]
low bits (suggested by Ilya Zakharevich)

p4raw-id: //depot/perl@1865

hv.h

diff --git a/hv.h b/hv.h
index 19694ac..466f33d 100644 (file)
--- a/hv.h
+++ b/hv.h
@@ -45,7 +45,7 @@ struct xpvhv {
        register U32 hash_PeRlHaSh = 0; \
        while (i_PeRlHaSh--) \
            hash_PeRlHaSh = hash_PeRlHaSh * 33 + *s_PeRlHaSh++; \
-       (hash) = hash_PeRlHaSh; \
+       (hash) = hash_PeRlHaSh + (hash_PeRlHaSh>>5); \
     } STMT_END