bpo-40602: Write unit tests for _Py_hashtable_t (GH-20091)

Cleanup also hashtable.c.
Rename _Py_hashtable_t members:

* Rename entries to nentries
* Rename num_buckets to nbuckets
This commit is contained in:
Victor Stinner 2020-05-14 21:55:47 +02:00 committed by GitHub
parent f2c3b6823b
commit a482dc500b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 151 additions and 120 deletions

View file

@ -312,7 +312,7 @@ w_ref(PyObject *v, char *flag, WFILE *p)
w_long(w, p);
return 1;
} else {
size_t s = p->hashtable->entries;
size_t s = p->hashtable->nentries;
/* we don't support long indices */
if (s >= 0x7fffffff) {
PyErr_SetString(PyExc_ValueError, "too many objects");