mirror of https://github.com/python/cpython
Harmonize the bottom of the outer loop with its entry point
giving a small simplification. Timings show that hash pre-check seems only benefit the inner-loop (the linear probes).
This commit is contained in:
parent
2e2f374098
commit
7e3592dca6
|
@ -118,7 +118,7 @@ set_lookkey(PySetObject *so, PyObject *key, Py_hash_t hash)
|
|||
i = (i * 5 + 1 + perturb) & mask;
|
||||
|
||||
entry = &table[i];
|
||||
if (entry->hash == 0 && entry->key == NULL)
|
||||
if (entry->key == NULL)
|
||||
return entry;
|
||||
}
|
||||
}
|
||||
|
@ -206,7 +206,7 @@ set_insert_key(PySetObject *so, PyObject *key, Py_hash_t hash)
|
|||
i = (i * 5 + 1 + perturb) & mask;
|
||||
|
||||
entry = &table[i];
|
||||
if (entry->hash == 0 && entry->key == NULL)
|
||||
if (entry->key == NULL)
|
||||
goto found_null;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue