Skip to content

Commit b051e7d

Browse files
committed
py: Simpler implementation of mp_obj_callable.
1 parent cfedd81 commit b051e7d

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

py/obj.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,7 @@ void mp_obj_print_exception(mp_obj_t exc) {
6666
}
6767

6868
bool mp_obj_is_callable(mp_obj_t o_in) {
69-
if (!MP_OBJ_IS_OBJ(o_in)) {
70-
return false;
71-
} else {
72-
mp_obj_base_t *o = o_in;
73-
return o->type->call != NULL;
74-
}
69+
return mp_obj_get_type(o_in)->call != NULL;
7570
}
7671

7772
machine_int_t mp_obj_hash(mp_obj_t o_in) {

0 commit comments

Comments
 (0)