Kaydet (Commit) ba40ec42 authored tarafından Fred Drake's avatar Fred Drake

Remove unnecessary intialization for the case of weakly-referencable objects;

the code necessary to accomplish this is simpler and faster if confined to
the object implementations, so we only do this there.

This causes no behaviorial changes beyond a (very slight) speedup.
üst 9b03e59d
......@@ -100,10 +100,6 @@ PyObject_Init(PyObject *op, PyTypeObject *tp)
/* Any changes should be reflected in PyObject_INIT (objimpl.h) */
op->ob_type = tp;
_Py_NewReference(op);
if (PyType_SUPPORTS_WEAKREFS(tp)) {
PyObject **weaklist = PyObject_GET_WEAKREFS_LISTPTR(op);
*weaklist = NULL;
}
return op;
}
......
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