mirror of
				https://github.com/python/cpython.git
				synced 2025-11-04 03:44:55 +00:00 
			
		
		
		
	turn some checks into assertions, since they are implied by the caller
Reviewed by Georg.
This commit is contained in:
		
							parent
							
								
									83a682da30
								
							
						
					
					
						commit
						67641d25d4
					
				
					 1 changed files with 2 additions and 4 deletions
				
			
		| 
						 | 
					@ -2945,10 +2945,8 @@ same_slots_added(PyTypeObject *a, PyTypeObject *b)
 | 
				
			||||||
    Py_ssize_t size;
 | 
					    Py_ssize_t size;
 | 
				
			||||||
    PyObject *slots_a, *slots_b;
 | 
					    PyObject *slots_a, *slots_b;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (base != b->tp_base)
 | 
					    assert(base == b->tp_base);
 | 
				
			||||||
        return 0;
 | 
					    assert(equiv_structs(a, base) && equiv_structs(b, base));
 | 
				
			||||||
    if (equiv_structs(a, base) && equiv_structs(b, base))
 | 
					 | 
				
			||||||
        return 1;
 | 
					 | 
				
			||||||
    size = base->tp_basicsize;
 | 
					    size = base->tp_basicsize;
 | 
				
			||||||
    if (a->tp_dictoffset == size && b->tp_dictoffset == size)
 | 
					    if (a->tp_dictoffset == size && b->tp_dictoffset == size)
 | 
				
			||||||
        size += sizeof(PyObject *);
 | 
					        size += sizeof(PyObject *);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue