aboutsummaryrefslogtreecommitdiff
path: root/py/objtype.c
diff options
context:
space:
mode:
authorDamien George2017-04-22 12:14:04 +1000
committerDamien George2017-04-22 12:14:04 +1000
commit4df013c8ccf2e122a1bd3dd75d3937d46019409a (patch)
treec82fe66833b8c9b3b908bdad2d25f2eb89a8bf0e /py/objtype.c
parent9e8f3163924c1f429f16f44a4a27b0cd33064719 (diff)
py/objtype: mp_obj_new_super doesn't need to be public, so inline it.
Saves code size (20 bytes on bare-arm) and makes it a tiny bit more efficient.
Diffstat (limited to 'py/objtype.c')
-rw-r--r--py/objtype.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/py/objtype.c b/py/objtype.c
index 5e522bed2..de1ee8c42 100644
--- a/py/objtype.c
+++ b/py/objtype.c
@@ -1013,7 +1013,9 @@ STATIC mp_obj_t super_make_new(const mp_obj_type_t *type_in, size_t n_args, size
// 0 arguments are turned into 2 in the compiler
// 1 argument is not yet implemented
mp_arg_check_num(n_args, n_kw, 2, 2, false);
- return mp_obj_new_super(args[0], args[1]);
+ mp_obj_super_t *o = m_new_obj(mp_obj_super_t);
+ *o = (mp_obj_super_t){{type_in}, args[0], args[1]};
+ return MP_OBJ_FROM_PTR(o);
}
STATIC void super_attr(mp_obj_t self_in, qstr attr, mp_obj_t *dest) {
@@ -1068,12 +1070,6 @@ const mp_obj_type_t mp_type_super = {
.attr = super_attr,
};
-mp_obj_t mp_obj_new_super(mp_obj_t type, mp_obj_t obj) {
- mp_obj_super_t *o = m_new_obj(mp_obj_super_t);
- *o = (mp_obj_super_t){{&mp_type_super}, type, obj};
- return MP_OBJ_FROM_PTR(o);
-}
-
/******************************************************************************/
// subclassing and built-ins specific to types