From b051e7d167ac00576e45a6a1de291b8ff6bcd6a3 Mon Sep 17 00:00:00 2001 From: Damien George Date: Thu, 23 Jan 2014 18:13:53 +0000 Subject: [PATCH] py: Simpler implementation of mp_obj_callable. --- py/obj.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/py/obj.c b/py/obj.c index 660df4dfa1..76a4d8f9b2 100644 --- a/py/obj.c +++ b/py/obj.c @@ -66,12 +66,7 @@ void mp_obj_print_exception(mp_obj_t exc) { } bool mp_obj_is_callable(mp_obj_t o_in) { - if (!MP_OBJ_IS_OBJ(o_in)) { - return false; - } else { - mp_obj_base_t *o = o_in; - return o->type->call != NULL; - } + return mp_obj_get_type(o_in)->call != NULL; } machine_int_t mp_obj_hash(mp_obj_t o_in) {