]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Remove unnecessary intialization for the case of weakly-referencable objects;
authorFred Drake <fdrake@acm.org>
Thu, 3 May 2001 19:44:50 +0000 (19:44 +0000)
committerFred Drake <fdrake@acm.org>
Thu, 3 May 2001 19:44:50 +0000 (19:44 +0000)
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.

Objects/object.c

index 04f75e95c1070a2ebfa84473ecf9689e942c9023..366d7773688f9be1c850a99227e3e6be0c85f4a0 100644 (file)
@@ -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;
 }