py: Convert some macros to inline functions (in obj.h).
Also convert mp_obj_is_integer to an inline function. Overall this decreased code size (at least on 32-bit x86 machine).
This commit is contained in:
5
py/obj.c
5
py/obj.c
@@ -99,11 +99,6 @@ int mp_obj_is_true(mp_obj_t arg) {
|
||||
}
|
||||
}
|
||||
|
||||
// returns true if o_in is bool, small int, or long int
|
||||
bool mp_obj_is_integer(mp_obj_t o_in) {
|
||||
return MP_OBJ_IS_INT(o_in) || MP_OBJ_IS_TYPE(o_in, &mp_type_bool);
|
||||
}
|
||||
|
||||
bool mp_obj_is_callable(mp_obj_t o_in) {
|
||||
return mp_obj_get_type(o_in)->call != NULL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user