From 717e3dca1b3ae736a683f8455a23c21192d6de69 Mon Sep 17 00:00:00 2001 From: Damien George Date: Tue, 20 Feb 2024 11:29:46 +1100 Subject: [PATCH] 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 --- py/objfun.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/py/objfun.c b/py/objfun.c index 992c8c7841..2e86aaa14d 100644 --- a/py/objfun.c +++ b/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