Skip to content

Commit 7aa8415

Browse files
committed
pybricks.common.Motor: Use existing macro for reduced table.
1 parent 88e79b9 commit 7aa8415

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

pybricks/common/pb_type_motor.c

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -488,17 +488,7 @@ STATIC const mp_rom_map_elem_t pb_type_Motor_locals_dict_table[] = {
488488
STATIC MP_DEFINE_CONST_DICT(pb_type_Motor_locals_dict, pb_type_Motor_locals_dict_table);
489489

490490
// The DC Motor methods are shared with the DCMotor class, so use the first section of the same table.
491-
STATIC const mp_obj_dict_t pb_type_DCMotor_locals_dict = {
492-
.base = {&mp_type_dict},
493-
.map = {
494-
.all_keys_are_qstrs = 1,
495-
.is_fixed = 1,
496-
.is_ordered = 1,
497-
.used = 5,
498-
.alloc = 5,
499-
.table = (mp_map_elem_t *)(mp_rom_map_elem_t *)pb_type_Motor_locals_dict_table,
500-
},
501-
};
491+
STATIC MP_DEFINE_CONST_DICT_WITH_SIZE(pb_type_DCMotor_locals_dict, pb_type_Motor_locals_dict_table, 5);
502492

503493
// type(pybricks.builtins.DCMotor)
504494
MP_DEFINE_CONST_OBJ_TYPE(pb_type_DCMotor,

0 commit comments

Comments
 (0)