summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorGregory P. Smith <greg@krypto.org>2012-01-14 23:45:13 (GMT)
committerGregory P. Smith <greg@krypto.org>2012-01-14 23:45:13 (GMT)
commitf5b62a9b314e71e6bd5014be92ad1d10ff8e0d63 (patch)
treefeb12ee5852eb7674802e9de3c2ef9c32c4f9ee6 /Include
parentd66b5051551b1d5199aaf5d30368d22232f49524 (diff)
parent63e6c3222f563cfb156de6e92199e9e35ad5d832 (diff)
downloadcpython-f5b62a9b314e71e6bd5014be92ad1d10ff8e0d63.zip
cpython-f5b62a9b314e71e6bd5014be92ad1d10ff8e0d63.tar.gz
cpython-f5b62a9b314e71e6bd5014be92ad1d10ff8e0d63.tar.bz2
Consolidate the occurrances of the prime used as the multiplier when hashing.
Diffstat (limited to 'Include')
-rw-r--r--Include/pyport.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/Include/pyport.h b/Include/pyport.h
index 5309de6..1fd4dcc 100644
--- a/Include/pyport.h
+++ b/Include/pyport.h
@@ -131,6 +131,9 @@ Used in: PY_LONG_LONG
#endif
#endif
+/* Prime multiplier used in string and various other hashes. */
+#define _PyHASH_MULTIPLIER 1000003 /* 0xf4243 */
+
/* Parameters used for the numeric hash implementation. See notes for
_Py_HashDouble in Objects/object.c. Numeric hashes are based on
reduction modulo the prime 2**_PyHASH_BITS - 1. */
@@ -143,7 +146,7 @@ Used in: PY_LONG_LONG
#define _PyHASH_MODULUS (((size_t)1 << _PyHASH_BITS) - 1)
#define _PyHASH_INF 314159
#define _PyHASH_NAN 0
-#define _PyHASH_IMAG 1000003UL
+#define _PyHASH_IMAG _PyHASH_MULTIPLIER
/* uintptr_t is the C9X name for an unsigned integral type such that a
* legitimate void* can be cast to uintptr_t and then back to void* again