kopia lustrzana https://github.com/micropython/micropython
py/objfun: Inline mp_obj_code_get_name() into mp_obj_fun_get_name().
The former is static and does not need to be a separate function. Signed-off-by: Damien George <damien@micropython.org>pull/13710/head
rodzic
0c7ccb8807
commit
717e3dca1b
18
py/objfun.c
18
py/objfun.c
|
@ -128,15 +128,6 @@ MP_DEFINE_CONST_OBJ_TYPE(
|
|||
/******************************************************************************/
|
||||
/* byte code functions */
|
||||
|
||||
STATIC qstr mp_obj_code_get_name(const mp_obj_fun_bc_t *fun, const byte *code_info) {
|
||||
MP_BC_PRELUDE_SIZE_DECODE(code_info);
|
||||
mp_uint_t name = mp_decode_uint_value(code_info);
|
||||
#if MICROPY_EMIT_BYTECODE_USES_QSTR_TABLE
|
||||
name = fun->context->constants.qstr_table[name];
|
||||
#endif
|
||||
return name;
|
||||
}
|
||||
|
||||
qstr mp_obj_fun_get_name(mp_const_obj_t fun_in) {
|
||||
const mp_obj_fun_bc_t *fun = MP_OBJ_TO_PTR(fun_in);
|
||||
const byte *bc = fun->bytecode;
|
||||
|
@ -148,7 +139,14 @@ qstr mp_obj_fun_get_name(mp_const_obj_t fun_in) {
|
|||
#endif
|
||||
|
||||
MP_BC_PRELUDE_SIG_DECODE(bc);
|
||||
return mp_obj_code_get_name(fun, bc);
|
||||
MP_BC_PRELUDE_SIZE_DECODE(bc);
|
||||
|
||||
mp_uint_t name = mp_decode_uint_value(bc);
|
||||
#if MICROPY_EMIT_BYTECODE_USES_QSTR_TABLE
|
||||
name = fun->context->constants.qstr_table[name];
|
||||
#endif
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
#if MICROPY_CPYTHON_COMPAT
|
||||
|
|
Ładowanie…
Reference in New Issue