diff options
author | Raymond Hettinger <rhettinger@users.noreply.github.com> | 2018-01-14 10:20:13 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-14 10:20:13 -0800 |
commit | 3329992e31bd0494a7d7312853f7ffd054737e27 (patch) | |
tree | a4e6479caf3c9a3978171327e277e1f5a9410576 /Objects/setobject.c | |
parent | Add itertools recipe for directly finding the n-th combination (#5161) (diff) | |
download | cpython-3329992e31bd0494a7d7312853f7ffd054737e27.tar.gz cpython-3329992e31bd0494a7d7312853f7ffd054737e27.tar.bz2 cpython-3329992e31bd0494a7d7312853f7ffd054737e27.zip |
bpo-29476: Simplify set_add_entry() (#5175)
Diffstat (limited to 'Objects/setobject.c')
-rw-r--r-- | Objects/setobject.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Objects/setobject.c b/Objects/setobject.c index cd5d2dd83c0..c920fb98534 100644 --- a/Objects/setobject.c +++ b/Objects/setobject.c @@ -187,7 +187,7 @@ set_add_entry(PySetObject *so, PyObject *key, Py_hash_t hash) goto restart; mask = so->mask; /* help avoid a register spill */ } - else if (entry->hash == -1 && freeslot == NULL) + else if (entry->hash == -1) freeslot = entry; if (i + LINEAR_PROBES <= mask) { @@ -216,7 +216,7 @@ set_add_entry(PySetObject *so, PyObject *key, Py_hash_t hash) goto restart; mask = so->mask; } - else if (entry->hash == -1 && freeslot == NULL) + else if (entry->hash == -1) freeslot = entry; } } |