Commit b72e21b9 authored by Raymond Hettinger's avatar Raymond Hettinger

Speed-up construction of empty sets by approx 12-14%.

parent 734f2846
...@@ -2015,10 +2015,11 @@ set_init(PySetObject *self, PyObject *args, PyObject *kwds) ...@@ -2015,10 +2015,11 @@ set_init(PySetObject *self, PyObject *args, PyObject *kwds)
if (!PyAnySet_Check(self)) if (!PyAnySet_Check(self))
return -1; return -1;
if (PySet_Check(self) && !_PyArg_NoKeywords("set()", kwds)) if (kwds != NULL && PySet_Check(self) && !_PyArg_NoKeywords("set()", kwds))
return -1; return -1;
if (!PyArg_UnpackTuple(args, Py_TYPE(self)->tp_name, 0, 1, &iterable)) if (!PyArg_UnpackTuple(args, Py_TYPE(self)->tp_name, 0, 1, &iterable))
return -1; return -1;
if (self->fill)
set_clear_internal(self); set_clear_internal(self);
self->hash = -1; self->hash = -1;
if (iterable == NULL) if (iterable == NULL)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment