summaryrefslogtreecommitdiff
path: root/Objects
diff options
context:
space:
mode:
authorRaymond Hettinger <rhettinger@users.noreply.github.com>2019-06-11 02:01:06 -0700
committerGitHub <noreply@github.com>2019-06-11 02:01:06 -0700
commit1b615b2f035d207941e44259a92ed0bdcc56ac45 (patch)
treeb15f171a96c871413d5535b8ee1bbb2c6799a7ac /Objects
parentc59b1bbbb37bbfc7eb7a9386bb51c7fea838fc2a (diff)
downloadcpython-git-1b615b2f035d207941e44259a92ed0bdcc56ac45.tar.gz
[3.7] bpo-37219: Remove erroneous optimization for differencing an empty set (GH-13965) (GH-13968)
Diffstat (limited to 'Objects')
-rw-r--r--Objects/setobject.c8
1 files changed, 0 insertions, 8 deletions
diff --git a/Objects/setobject.c b/Objects/setobject.c
index 357e48ca3c..1e4781fe11 100644
--- a/Objects/setobject.c
+++ b/Objects/setobject.c
@@ -1478,10 +1478,6 @@ PyDoc_STRVAR(isdisjoint_doc,
static int
set_difference_update_internal(PySetObject *so, PyObject *other)
{
- if (PySet_GET_SIZE(so) == 0) {
- return 0;
- }
-
if ((PyObject *)so == other)
return set_clear_internal(so);
@@ -1556,10 +1552,6 @@ set_difference(PySetObject *so, PyObject *other)
Py_ssize_t pos = 0, other_size;
int rv;
- if (PySet_GET_SIZE(so) == 0) {
- return set_copy(so);
- }
-
if (PyAnySet_Check(other)) {
other_size = PySet_GET_SIZE(other);
}