From: Benjamin Peterson Date: Mon, 17 Jan 2011 19:24:34 +0000 (+0000) Subject: turn some checks into assertions, since they are implied by the caller X-Git-Tag: v3.2rc2~136 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=67641d25d4b2ba4f49fb597cf81993333e9b0750;p=python turn some checks into assertions, since they are implied by the caller Reviewed by Georg. --- diff --git a/Objects/typeobject.c b/Objects/typeobject.c index 87c8723ee9..325b8254b5 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -2945,10 +2945,8 @@ same_slots_added(PyTypeObject *a, PyTypeObject *b) Py_ssize_t size; PyObject *slots_a, *slots_b; - if (base != b->tp_base) - return 0; - if (equiv_structs(a, base) && equiv_structs(b, base)) - return 1; + assert(base == b->tp_base); + assert(equiv_structs(a, base) && equiv_structs(b, base)); size = base->tp_basicsize; if (a->tp_dictoffset == size && b->tp_dictoffset == size) size += sizeof(PyObject *);