mirror of
https://github.com/micropython/micropython.git
synced 2025-12-15 17:30:14 +01:00
py/objtype: Use locals_ptr directly instead of getting it from the slot.
This is a very minor code simplification, which reduces code size by about -8 bytes. It should have no functional change. Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
@@ -1292,8 +1292,7 @@ static mp_obj_t mp_obj_new_type(qstr name, mp_obj_t bases_tuple, mp_obj_t locals
|
||||
mp_raise_TypeError(MP_ERROR_TEXT("multiple bases have instance lay-out conflict"));
|
||||
}
|
||||
|
||||
mp_map_t *locals_map = &MP_OBJ_TYPE_GET_SLOT(o, locals_dict)->map;
|
||||
mp_map_elem_t *elem = mp_map_lookup(locals_map, MP_OBJ_NEW_QSTR(MP_QSTR___new__), MP_MAP_LOOKUP);
|
||||
mp_map_elem_t *elem = mp_map_lookup(&locals_ptr->map, MP_OBJ_NEW_QSTR(MP_QSTR___new__), MP_MAP_LOOKUP);
|
||||
if (elem != NULL) {
|
||||
// __new__ slot exists; check if it is a function
|
||||
if (mp_obj_is_fun(elem->value)) {
|
||||
|
||||
Reference in New Issue
Block a user