]> granicus.if.org Git - python/commitdiff
turn some checks into assertions, since they are implied by the caller
authorBenjamin Peterson <benjamin@python.org>
Mon, 17 Jan 2011 19:24:34 +0000 (19:24 +0000)
committerBenjamin Peterson <benjamin@python.org>
Mon, 17 Jan 2011 19:24:34 +0000 (19:24 +0000)
Reviewed by Georg.

Objects/typeobject.c

index 87c8723ee9cb3144336e0c96536ecd3e39057e25..325b8254b5d555b2542e3b624a1ba81b6a342a17 100644 (file)
@@ -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 *);