]> 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:45:34 +0000 (19:45 +0000)
committerFred Drake <fdrake@acm.org>
Thu, 3 May 2001 19:45:34 +0000 (19:45 +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 47907bcb1d7f558ad6aa621f3303365bd61f209d..81b1404136793c0afdc66e6bd94592d5c09bd225 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;
 }