mirror of
https://github.com/python/cpython.git
synced 2025-10-09 08:31:26 +00:00
[3.13] gh-111389: Add PyHASH_MULTIPLIER constant (GH-119214) (#119334)
gh-111389: Add PyHASH_MULTIPLIER constant (GH-119214)
(cherry picked from commit f6da790122
)
Co-authored-by: Victor Stinner <vstinner@python.org>
This commit is contained in:
parent
6be55f1bed
commit
1177897551
7 changed files with 16 additions and 7 deletions
|
@ -2020,7 +2020,7 @@ code_hash(PyCodeObject *co)
|
|||
Py_uhash_t uhash = 20221211;
|
||||
#define SCRAMBLE_IN(H) do { \
|
||||
uhash ^= (Py_uhash_t)(H); \
|
||||
uhash *= _PyHASH_MULTIPLIER; \
|
||||
uhash *= PyHASH_MULTIPLIER; \
|
||||
} while (0)
|
||||
#define SCRAMBLE_IN_HASH(EXPR) do { \
|
||||
Py_hash_t h = PyObject_Hash(EXPR); \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue