summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorRaymond Hettinger <rhettinger@users.noreply.github.com>2018-01-14 18:20:13 (GMT)
committerGitHub <noreply@github.com>2018-01-14 18:20:13 (GMT)
commit3329992e31bd0494a7d7312853f7ffd054737e27 (patch)
treea4e6479caf3c9a3978171327e277e1f5a9410576 /Objects
parentd37258dd2e189141906bd234385096cd8e885d8d (diff)
downloadcpython-3329992e31bd0494a7d7312853f7ffd054737e27.zip
cpython-3329992e31bd0494a7d7312853f7ffd054737e27.tar.gz
cpython-3329992e31bd0494a7d7312853f7ffd054737e27.tar.bz2
bpo-29476: Simplify set_add_entry() (#5175)
Diffstat (limited to 'Objects')
-rw-r--r--Objects/setobject.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Objects/setobject.c b/Objects/setobject.c
index cd5d2dd..c920fb9 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;
}
}