[Python-checkins] bpo-29476: Simplify set_add_entry() (#5175)
Raymond Hettinger
webhook-mailer at python.org
Sun Jan 14 13:20:16 EST 2018
https://github.com/python/cpython/commit/3329992e31bd0494a7d7312853f7ffd054737e27
commit: 3329992e31bd0494a7d7312853f7ffd054737e27
branch: master
author: Raymond Hettinger <rhettinger at users.noreply.github.com>
committer: GitHub <noreply at github.com>
date: 2018-01-14T10:20:13-08:00
summary:
bpo-29476: Simplify set_add_entry() (#5175)
files:
M Objects/setobject.c
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;
}
}
More information about the Python-checkins
mailing list