summaryrefslogtreecommitdiff
path: root/hv.h
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1998-09-24 04:52:48 +0000
committerGurusamy Sarathy <gsar@cpan.org>1998-09-24 04:52:48 +0000
commit8ac04967afa079525f14b42d77496f34f82a67de (patch)
treeaeebdde52fe7d7b01635b7778afe2760e6394e60 /hv.h
parentd3b6f988cac8d2811966703f0abfa69a19d8e06a (diff)
downloadperl-8ac04967afa079525f14b42d77496f34f82a67de.tar.gz
tweak PERL_HASH() to h=h+(h>>5) in order to improve distribution of
low bits (suggested by Ilya Zakharevich) p4raw-id: //depot/perl@1865
Diffstat (limited to 'hv.h')
-rw-r--r--hv.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/hv.h b/hv.h
index 19694ac5d1..466f33d2bb 100644
--- 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