Commit b5cef5c7 authored by Kaspar Schleiser's avatar Kaspar Schleiser Committed by Damien George
Browse files

py/objobject: Don't make locals_dict if there's nothing to go in it.

parent cf5112b2
...@@ -59,7 +59,6 @@ STATIC mp_obj_t object___new__(mp_obj_t cls) { ...@@ -59,7 +59,6 @@ STATIC mp_obj_t object___new__(mp_obj_t cls) {
} }
STATIC MP_DEFINE_CONST_FUN_OBJ_1(object___new___fun_obj, object___new__); STATIC MP_DEFINE_CONST_FUN_OBJ_1(object___new___fun_obj, object___new__);
STATIC MP_DEFINE_CONST_STATICMETHOD_OBJ(object___new___obj, (const mp_obj_t)&object___new___fun_obj); STATIC MP_DEFINE_CONST_STATICMETHOD_OBJ(object___new___obj, (const mp_obj_t)&object___new___fun_obj);
#endif
STATIC const mp_map_elem_t object_locals_dict_table[] = { STATIC const mp_map_elem_t object_locals_dict_table[] = {
#if MICROPY_CPYTHON_COMPAT #if MICROPY_CPYTHON_COMPAT
...@@ -71,10 +70,13 @@ STATIC const mp_map_elem_t object_locals_dict_table[] = { ...@@ -71,10 +70,13 @@ STATIC const mp_map_elem_t object_locals_dict_table[] = {
}; };
STATIC MP_DEFINE_CONST_DICT(object_locals_dict, object_locals_dict_table); STATIC MP_DEFINE_CONST_DICT(object_locals_dict, object_locals_dict_table);
#endif
const mp_obj_type_t mp_type_object = { const mp_obj_type_t mp_type_object = {
{ &mp_type_type }, { &mp_type_type },
.name = MP_QSTR_object, .name = MP_QSTR_object,
.make_new = object_make_new, .make_new = object_make_new,
#if MICROPY_CPYTHON_COMPAT
.locals_dict = (mp_obj_t)&object_locals_dict, .locals_dict = (mp_obj_t)&object_locals_dict,
#endif
}; };
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment