summaryrefslogtreecommitdiff
path: root/py/objfun.c
diff options
context:
space:
mode:
authorDamien George <damien@micropython.org>2024-02-20 11:29:46 +1100
committerDamien George <damien@micropython.org>2024-02-20 11:29:46 +1100
commit717e3dca1b3ae736a683f8455a23c21192d6de69 (patch)
tree693e50ade9be7406b61fe3d0af6a7b4c230898d3 /py/objfun.c
parent0c7ccb8807581f3654f70ee9ea86d3ca017f7ea2 (diff)
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>
Diffstat (limited to 'py/objfun.c')
-rw-r--r--py/objfun.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/py/objfun.c b/py/objfun.c
index 992c8c784..2e86aaa14 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