gh-122854: Add Py_HashBuffer() function (#122855)

This commit is contained in:
Victor Stinner 2024-08-30 17:42:27 +02:00 committed by GitHub
parent 3d60dfbe17
commit d8e69b2c1b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 80 additions and 25 deletions

View file

@ -11688,7 +11688,7 @@ unicode_hash(PyObject *self)
if (hash != -1) {
return hash;
}
x = _Py_HashBytes(PyUnicode_DATA(self),
x = Py_HashBuffer(PyUnicode_DATA(self),
PyUnicode_GET_LENGTH(self) * PyUnicode_KIND(self));
FT_ATOMIC_STORE_SSIZE_RELAXED(_PyUnicode_HASH(self), x);