From: Fred Drake Date: Thu, 3 May 2001 19:45:34 +0000 (+0000) Subject: Remove unnecessary intialization for the case of weakly-referencable objects; X-Git-Tag: v2.1.1c1~146 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=03d855434dcb913be40b8d8a5823973c37f410ef;p=thirdparty%2FPython%2Fcpython.git 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. --- diff --git a/Objects/object.c b/Objects/object.c index 47907bcb1d7f..81b140413679 100644 --- a/Objects/object.c +++ b/Objects/object.c @@ -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; }