aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Python/hashtable.c
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2020-05-12 18:46:20 +0200
committerGitHub <noreply@github.com>2020-05-12 18:46:20 +0200
commitf453221c8b80e0570066a9375337f208d50e6406 (patch)
tree9ea682c978b6a302388c4df1b8174d5188e0b2d2 /Python/hashtable.c
parent4c9ea093cd752a6687864674d34250653653f743 (diff)
downloadcpython-f453221c8b80e0570066a9375337f208d50e6406.tar.gz
cpython-f453221c8b80e0570066a9375337f208d50e6406.zip
bpo-40602: Add _Py_HashPointerRaw() function (GH-20056)
Add a new _Py_HashPointerRaw() function which avoids replacing -1 with -2 to micro-optimize hash table using pointer keys: using _Py_hashtable_hash_ptr() hash function.
Diffstat (limited to 'Python/hashtable.c')
-rw-r--r--Python/hashtable.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Python/hashtable.c b/Python/hashtable.c
index 1548c2e4618..90fe34e6280 100644
--- a/Python/hashtable.c
+++ b/Python/hashtable.c
@@ -109,7 +109,7 @@ _Py_hashtable_hash_ptr(struct _Py_hashtable_t *ht, const void *pkey)
{
void *key;
_Py_HASHTABLE_READ_KEY(ht, pkey, key);
- return (Py_uhash_t)_Py_HashPointer(key);
+ return (Py_uhash_t)_Py_HashPointerRaw(key);
}