py: mp_obj_get_type_qstr as macro saves 24 bytes

This commit is contained in:
Jeff Epler 2020-08-04 14:05:32 -05:00
parent c0b32976e8
commit 65e26f4a06
2 changed files with 1 additions and 5 deletions

View File

@ -57,10 +57,6 @@ mp_obj_type_t *mp_obj_get_type(mp_const_obj_t o_in) {
}
}
qstr mp_obj_get_type_qstr(mp_const_obj_t o_in) {
return mp_obj_get_type(o_in)->name;
}
const char *mp_obj_get_type_str(mp_const_obj_t o_in) {
return qstr_str(mp_obj_get_type_qstr(o_in));
}

View File

@ -680,7 +680,7 @@ mp_obj_t mp_obj_new_memoryview(byte typecode, size_t nitems, void *items);
mp_obj_type_t *mp_obj_get_type(mp_const_obj_t o_in);
const char *mp_obj_get_type_str(mp_const_obj_t o_in);
qstr mp_obj_get_type_qstr(mp_const_obj_t o_in);
#define mp_obj_get_type_qstr(o_in) (mp_obj_get_type((o_in))->name)
bool mp_obj_is_subclass_fast(mp_const_obj_t object, mp_const_obj_t classinfo); // arguments should be type objects
mp_obj_t mp_instance_cast_to_native_base(mp_obj_t self_in, mp_const_obj_t native_type);