From 3329992e31bd0494a7d7312853f7ffd054737e27 Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Sun, 14 Jan 2018 10:20:13 -0800 Subject: [PATCH] bpo-29476: Simplify set_add_entry() (#5175) --- Objects/setobject.c | 4 ++-- 1 file 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; } }